Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.
Important

IBM Quantum Platform is moving and this version will be sunset on July 1. To get started on the new platform, read the migration guide.

HartreeFock

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

GitHub

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.

Attributes

bitstr

Getter of the bit string represented the statevector.


Methods

construct_circuit

HartreeFock.construct_circuit(mode='circuit', register=None)

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’.

Was this page helpful?
Report a bug or request content on GitHub.