# openfermion.circuits.prepare_gaussian_state

Prepare a fermionic Gaussian state from a computational basis state.

A fermionic Gaussian state is an eigenstate of a quadratic Hamiltonian. If the Hamiltonian conserves particle number, then it is a Slater determinant. The algorithm used is described in arXiv:1711.05395. It assumes the Jordan-Wigner transform.

`qubits` The qubits to which to apply the circuit.
`quadratic_hamiltonian` The Hamiltonian whose eigenstate is desired.
`occupied_orbitals` Integers representing the indices of the pseudoparticle orbitals to occupy in the Gaussian state. If two lists are given, then the first list specifies spin-up orbitals and the second list specifies spin-down orbitals, and the modes are assumed to be ordered so that spin-up modes come before spin-down modes. Two lists should be given only if the Hamiltonian contains a spin degree of freedom and modes with different spin do not interact. The orbitals are ordered in ascending order of energy. The default behavior is to fill the orbitals with negative energy, i.e., prepare the ground state.
`initial_state` The computational basis state that the qubits start in. This can be either an integer or a sequence 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 sequence 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" }]