87 lines
4.9 KiB
Plaintext
87 lines
4.9 KiB
Plaintext
---
|
||
title: HartreeFock
|
||
description: API reference for qiskit.chemistry.components.initial_states.HartreeFock
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.chemistry.components.initial_states.HartreeFock
|
||
---
|
||
|
||
# qiskit.chemistry.components.initial\_states.HartreeFock
|
||
|
||
<Class id="qiskit.chemistry.components.initial_states.HartreeFock" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/chemistry/components/initial_states/hartree_fock.py" signature="HartreeFock(num_orbitals, num_particles, qubit_mapping='parity', two_qubit_reduction=True, sq_list=None)" modifiers="class">
|
||
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\_\_
|
||
|
||
<Function id="qiskit.chemistry.components.initial_states.HartreeFock.__init__" signature="__init__(num_orbitals, num_particles, qubit_mapping='parity', two_qubit_reduction=True, sq_list=None)">
|
||
**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.
|
||
</Function>
|
||
|
||
## Methods
|
||
|
||
| | |
|
||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
||
| [`__init__`](#qiskit.chemistry.components.initial_states.HartreeFock.__init__ "qiskit.chemistry.components.initial_states.HartreeFock.__init__")(num\_orbitals, num\_particles\[, …]) | **type num\_orbitals**`int` |
|
||
| [`construct_circuit`](#qiskit.chemistry.components.initial_states.HartreeFock.construct_circuit "qiskit.chemistry.components.initial_states.HartreeFock.construct_circuit")(\[mode, register]) | Construct the statevector of desired initial state. |
|
||
|
||
## Attributes
|
||
|
||
| | |
|
||
| ------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
|
||
| [`bitstr`](#qiskit.chemistry.components.initial_states.HartreeFock.bitstr "qiskit.chemistry.components.initial_states.HartreeFock.bitstr") | Getter of the bit string represented the statevector. |
|
||
|
||
### bitstr
|
||
|
||
<Attribute id="qiskit.chemistry.components.initial_states.HartreeFock.bitstr">
|
||
Getter of the bit string represented the statevector.
|
||
</Attribute>
|
||
|
||
### construct\_circuit
|
||
|
||
<Function id="qiskit.chemistry.components.initial_states.HartreeFock.construct_circuit" signature="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*](qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")) – register for circuit construction.
|
||
|
||
**Returns**
|
||
|
||
statevector.
|
||
|
||
**Return type**
|
||
|
||
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") or numpy.ndarray
|
||
|
||
**Raises**
|
||
|
||
**ValueError** – when mode is not ‘vector’ or ‘circuit’.
|
||
</Function>
|
||
</Class>
|
||
|