# qiskit.chemistry.components.initial_states.HartreeFock¶

class HartreeFock(num_orbitals, num_particles, qubit_mapping='parity', two_qubit_reduction=True, sq_list=None)[source]

A Hartree-Fock initial state.

Parameters
• num_orbitals (int) – number of spin orbitals, has a min. value of 1.

• num_particles (Union[List[int], int]) – number of particles, if it is a list, the first number is alpha and the second number if beta.

• qubit_mapping (str) – mapping type for qubit operator

• two_qubit_reduction (bool) – flag indicating whether or not two qubit is reduced

• sq_list (Optional[List[int]]) – position of the single-qubit operators that anticommute with the cliffords

Raises
• ValueError – wrong setting in num_particles and num_orbitals.

• ValueError – wrong setting for computed num_qubits and supplied num_qubits.

__init__(num_orbitals, num_particles, qubit_mapping='parity', two_qubit_reduction=True, sq_list=None)[source]
Parameters
• num_orbitals (int) – number of spin orbitals, has a min. value of 1.

• num_particles (Union[List[int], int]) – number of particles, if it is a list, the first number is alpha and the second number if beta.

• qubit_mapping (str) – mapping type for qubit operator

• two_qubit_reduction (bool) – flag indicating whether or not two qubit is reduced

• sq_list (Optional[List[int]]) – position of the single-qubit operators that anticommute with the cliffords

Raises
• ValueError – wrong setting in num_particles and num_orbitals.

• ValueError – wrong setting for computed num_qubits and supplied num_qubits.

Methods

 __init__(num_orbitals, num_particles[, …]) type num_orbitals int construct_circuit([mode, register]) Construct the statevector of desired initial state.

Attributes

 bitstr Getter of the bit string represented the statevector.
property bitstr

Getter of the bit string represented the statevector.

construct_circuit(mode='circuit', register=None)[source]

Construct the statevector of desired initial state.

Parameters
• mode (string) – vector or circuit. The vector mode produces the vector. While the circuit constructs the quantum circuit corresponding that vector.

• register (QuantumRegister) – register for circuit construction.

Returns

statevector.

Return type

QuantumCircuit or numpy.ndarray

Raises

ValueError – when mode is not ‘vector’ or ‘circuit’.