# openfermion.circuits.prepare_slater_determinant

Prepare a Slater determinant from a computational basis state.

A Slater determinant is described by an $$\eta \times N$$ matrix $$Q$$ with orthonormal rows, where $$\eta$$ is the particle number and $$N$$ is the total number of modes. The state corresponding to this matrix is

$b^\dagger_1 \cdots b^\dagger_{\eta} \lvert \text{vac} \rangle,$

where

$b^\dagger_j = \sum_{k = 1}^N Q_{jk} a^\dagger_k.$

The algorithm used is described in arXiv:1711.05395. It assumes the Jordan-Wigner transform.

qubits The qubits to which to apply the circuit.
slater_determinant_matrix The matrix $$Q$$ which describes the Slater determinant to be prepared.
initial_state The computational basis state that the qubits start in. This can be either an integer or a container of integers. If an integer, it is mapped to a computational basis state via "big endian" ordering of the binary representation of the integer. For example, the computational basis state on five qubits with the first and second qubits set to one is 0b11000, which is 24 in decimal. If a container of integers, then it contains the indices of the qubits that are set to one (indexing starts from 0). For example, the list [2, 3] represents qubits 2 and 3 being set to one. Default is 0, the all zeros state.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]