Members:
| Name | Description |
|---|
FermionHamiltonianProblem | Defines an electronic-structure problem using a Fermionic operator and electron count. |
FermionHamiltonianProblem
Defines an electronic-structure problem using a Fermionic operator and electron count.
Can also be constructed from a MolecularData object using the from_molecule
method.
Methods:
| Name | Description |
|---|
| from_molecule | Constructs a FermionHamiltonianProblem from a molecule data. |
Attributes:
| Name | Type | Description |
|---|
fermion_hamiltonian | FermionOperator | The fermionic hamiltonian of the problem. Assumed to be in the block-spin labeling. |
n_orbitals | int | Number of spatial orbitals. |
n_alpha | int | Number of alpha particles. |
n_beta | int | Number of beta particles. |
n_particles | tuple[int, int] | Number of alpha and beta particles. |
fermion_hamiltonian
fermion_hamiltonian = fermion_hamiltonian
n_particles
n_particles = n_particles
n_orbitals
n_orbitals = min_n_orbitals
occupied_alpha
occupied_alpha: list[int]
virtual_alpha
virtual_alpha: list[int]
occupied_beta
occupied_beta: list[int]
virtual_beta
virtual_beta: list[int]
occupied
occupied: list[int]
virtual
virtual: list[int]
from_molecule
from_molecule(
cls: ,
molecule: MolecularData,
first_active_index: int = 0,
remove_orbitlas: Sequence[int] | None = None,
remove_orbitals: Sequence[int] | None = None,
op_compression_tol: float = 1e-13
) -> FermionHamiltonianProblem
Constructs a FermionHamiltonianProblem from a molecule data.
Parameters:
| Name | Type | Description | Default |
|---|
cls | “ | | required |
molecule | MolecularData | The molecule data. | required |
first_active_index | int | The first active index, indicates all prior indices are freezed. | 0 |
remove_orbitlas | Sequence[int] | None | | None |
remove_orbitals | Sequence[int] | None | Active indices to be removed. | None |
op_compression_tol | float | Tolerance for trimming the fermion operator. | 1e-13 |
Returns:
- Type:
FermionHamiltonianProblem
- The fermion hamiltonian problem.
Members:
| Name | Description |
|---|
FermionHamiltonianProblem | Defines an electronic-structure problem using a Fermionic operator and electron count. |
MappingMethod | Mapping methods from fermionic operators to qubits operators. |
FermionToQubitMapper | Mapper between fermionic operators to qubits operators, using one of the supported mapping methods (see MappingMethod). |
FermionHamiltonianProblem
Defines an electronic-structure problem using a Fermionic operator and electron count.
Can also be constructed from a MolecularData object using the from_molecule
method.
Methods:
| Name | Description |
|---|
| from_molecule | Constructs a FermionHamiltonianProblem from a molecule data. |
Attributes:
| Name | Type | Description |
|---|
fermion_hamiltonian | FermionOperator | The fermionic hamiltonian of the problem. Assumed to be in the block-spin labeling. |
n_orbitals | int | Number of spatial orbitals. |
n_alpha | int | Number of alpha particles. |
n_beta | int | Number of beta particles. |
n_particles | tuple[int, int] | Number of alpha and beta particles. |
fermion_hamiltonian
fermion_hamiltonian = fermion_hamiltonian
n_particles
n_particles = n_particles
n_orbitals
n_orbitals = min_n_orbitals
occupied_alpha
occupied_alpha: list[int]
virtual_alpha
virtual_alpha: list[int]
occupied_beta
occupied_beta: list[int]
virtual_beta
virtual_beta: list[int]
occupied
occupied: list[int]
virtual
virtual: list[int]
from_molecule
from_molecule(
cls: ,
molecule: MolecularData,
first_active_index: int = 0,
remove_orbitlas: Sequence[int] | None = None,
remove_orbitals: Sequence[int] | None = None,
op_compression_tol: float = 1e-13
) -> FermionHamiltonianProblem
Constructs a FermionHamiltonianProblem from a molecule data.
Parameters:
| Name | Type | Description | Default |
|---|
cls | “ | | required |
molecule | MolecularData | The molecule data. | required |
first_active_index | int | The first active index, indicates all prior indices are freezed. | 0 |
remove_orbitlas | Sequence[int] | None | | None |
remove_orbitals | Sequence[int] | None | Active indices to be removed. | None |
op_compression_tol | float | Tolerance for trimming the fermion operator. | 1e-13 |
Returns:
- Type:
FermionHamiltonianProblem
- The fermion hamiltonian problem.
MappingMethod
Mapping methods from fermionic operators to qubits operators.
Attributes:
JORDAN_WIGNER
BRAVYI_KITAEV
FermionToQubitMapper
Mapper between fermionic operators to qubits operators, using one of the supported
mapping methods (see MappingMethod).
Methods:
| Name | Description |
|---|
| map | Maps the given fermionic operator to a qubits operator using the mapper’s configuration. |
| get_num_qubits | Gets the number of qubits after mapping the given problem into qubits space. |
Attributes:
| Name | Type | Description |
|---|
method | MappingMethod | The mapping method. |
method
method = method
map
map(
self: ,
fermion_op: FermionOperator,
args: Any = (),
kwargs: Any =
) -> QubitOperator
Maps the given fermionic operator to a qubits operator using the mapper’s
configuration.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
fermion_op | FermionOperator | A fermionic operator. | required |
args | Any | | () |
kwargs | Any | | |
Returns:
- Type:
QubitOperator
- The mapped qubits operator.
get_num_qubits
get_num_qubits(
self: ,
problem: FermionHamiltonianProblem
) -> int
Gets the number of qubits after mapping the given problem into qubits space.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
problem | FermionHamiltonianProblem | The fermion problem. | required |
Returns:
- Type:
int
- The number of qubits.
Members:
| Name | Description |
|---|
FermionToQubitMapper | Mapper between fermionic operators to qubits operators, using one of the supported mapping methods (see MappingMethod). |
MappingMethod | Mapping methods from fermionic operators to qubits operators. |
FermionHamiltonianProblem | Defines an electronic-structure problem using a Fermionic operator and electron count. |
Z2SymTaperMapper | Mapper between fermionic operators to qubits operators, using one of the supported mapping methods (see MappingMethod), and taking advantage of Z… |
FermionToQubitMapper
Mapper between fermionic operators to qubits operators, using one of the supported
mapping methods (see MappingMethod).
Methods:
| Name | Description |
|---|
| map | Maps the given fermionic operator to a qubits operator using the mapper’s configuration. |
| get_num_qubits | Gets the number of qubits after mapping the given problem into qubits space. |
Attributes:
| Name | Type | Description |
|---|
method | MappingMethod | The mapping method. |
method
method = method
map
map(
self: ,
fermion_op: FermionOperator,
args: Any = (),
kwargs: Any =
) -> QubitOperator
Maps the given fermionic operator to a qubits operator using the mapper’s
configuration.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
fermion_op | FermionOperator | A fermionic operator. | required |
args | Any | | () |
kwargs | Any | | |
Returns:
- Type:
QubitOperator
- The mapped qubits operator.
get_num_qubits
get_num_qubits(
self: ,
problem: FermionHamiltonianProblem
) -> int
Gets the number of qubits after mapping the given problem into qubits space.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
problem | FermionHamiltonianProblem | The fermion problem. | required |
Returns:
- Type:
int
- The number of qubits.
MappingMethod
Mapping methods from fermionic operators to qubits operators.
Attributes:
JORDAN_WIGNER
BRAVYI_KITAEV
FermionHamiltonianProblem
Defines an electronic-structure problem using a Fermionic operator and electron count.
Can also be constructed from a MolecularData object using the from_molecule
method.
Methods:
| Name | Description |
|---|
| from_molecule | Constructs a FermionHamiltonianProblem from a molecule data. |
Attributes:
| Name | Type | Description |
|---|
fermion_hamiltonian | FermionOperator | The fermionic hamiltonian of the problem. Assumed to be in the block-spin labeling. |
n_orbitals | int | Number of spatial orbitals. |
n_alpha | int | Number of alpha particles. |
n_beta | int | Number of beta particles. |
n_particles | tuple[int, int] | Number of alpha and beta particles. |
fermion_hamiltonian
fermion_hamiltonian = fermion_hamiltonian
n_particles
n_particles = n_particles
n_orbitals
n_orbitals = min_n_orbitals
occupied_alpha
occupied_alpha: list[int]
virtual_alpha
virtual_alpha: list[int]
occupied_beta
occupied_beta: list[int]
virtual_beta
virtual_beta: list[int]
occupied
occupied: list[int]
virtual
virtual: list[int]
from_molecule
from_molecule(
cls: ,
molecule: MolecularData,
first_active_index: int = 0,
remove_orbitlas: Sequence[int] | None = None,
remove_orbitals: Sequence[int] | None = None,
op_compression_tol: float = 1e-13
) -> FermionHamiltonianProblem
Constructs a FermionHamiltonianProblem from a molecule data.
Parameters:
| Name | Type | Description | Default |
|---|
cls | “ | | required |
molecule | MolecularData | The molecule data. | required |
first_active_index | int | The first active index, indicates all prior indices are freezed. | 0 |
remove_orbitlas | Sequence[int] | None | | None |
remove_orbitals | Sequence[int] | None | Active indices to be removed. | None |
op_compression_tol | float | Tolerance for trimming the fermion operator. | 1e-13 |
Returns:
- Type:
FermionHamiltonianProblem
- The fermion hamiltonian problem.
Z2SymTaperMapper
Mapper between fermionic operators to qubits operators, using one of the supported
mapping methods (see MappingMethod), and taking advantage of Z2 symmetries in
order to taper off qubits.
Methods:
| Name | Description |
|---|
| set_sector | Sets the symmetry sector coefficients. |
| map | Maps the given fermionic operator to qubits operator by using the mapper’s method, and subsequently by tapering off qubits according to Z2 symmetries. |
| get_num_qubits | Gets the number of qubits after mapping the given problem into qubits space. |
| from_problem | Initializes a Z2SymTaperMapper object from a fermion problem (i.e. |
Attributes:
| Name | Type | Description |
|---|
method | MappingMethod | The mapping method. |
generators | tuple[QubitOperator, ...] | Generators representing the Z2 symmetries. |
x_ops | tuple[QubitOperator, ...] | Single-qubit X operations, such that each operation anti-commutes with its matching generator and commutes with all other generators. |
generators
generators: tuple[QubitOperator, ...]
x_ops
x_ops: tuple[QubitOperator, ...]
set_sector
set_sector(
self: ,
sector: Sequence[int]
) -> None
Sets the symmetry sector coefficients.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
sector | Sequence[int] | (Sequence[int]): Symmetry sector coefficients, each is 1 or -1. | required |
map
map(
self: ,
fermion_op: FermionOperator,
args: Any = (),
is_invariant: bool = False,
kwargs: Any =
) -> QubitOperator
Maps the given fermionic operator to qubits operator by using the
mapper’s method, and subsequently by tapering off qubits according to Z2
symmetries.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
fermion_op | FermionOperator | A fermionic operator. | required |
args | Any | | () |
is_invariant | bool | If False, the operator is not necessarily in the symmetry subspace, and thus gets projected onto it before tapering. | False |
kwargs | Any | | |
Returns:
- Type:
QubitOperator
- The mapped qubits operator.
get_num_qubits
get_num_qubits(
self: ,
problem: FermionHamiltonianProblem
) -> int
Gets the number of qubits after mapping the given problem into qubits space.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
problem | FermionHamiltonianProblem | The fermion problem. | required |
Returns:
- Type:
int
- The number of qubits.
from_problem
from_problem(
cls: ,
problem: FermionHamiltonianProblem,
method: MappingMethod = MappingMethod.JORDAN_WIGNER,
sector_from_hartree_fock: bool = True,
tol: float = 1e-14
) -> Z2SymTaperMapper
Initializes a Z2SymTaperMapper object from a fermion problem (i.e. computing
the Z2 symmetries from the problem definition).
Parameters:
| Name | Type | Description | Default |
|---|
cls | “ | | required |
problem | FermionHamiltonianProblem | The fermion problem. | required |
method | MappingMethod | The mapping method. | MappingMethod.JORDAN_WIGNER |
sector_from_hartree_fock | bool | Whether to compute the symmetry sector coefficients according to the Hartree-Fock state. | True |
tol | float | Tolerance for trimming off terms. | 1e-14 |
Returns:
- Type:
Z2SymTaperMapper
- The Z2 symmetries taper mapper.
Members:
| Name | Description |
|---|
FermionToQubitMapper | Mapper between fermionic operators to qubits operators, using one of the supported mapping methods (see MappingMethod). |
FermionHamiltonianProblem | Defines an electronic-structure problem using a Fermionic operator and electron count. |
get_hf_fermion_op | Constructs a fermion operator that creates the Hartree-Fock reference state in block-spin ordering. |
get_hf_state | Computes the qubits state after applying the Hartree-Fock operator defined by the given problem and mapper. |
FermionToQubitMapper
Mapper between fermionic operators to qubits operators, using one of the supported
mapping methods (see MappingMethod).
Methods:
| Name | Description |
|---|
| map | Maps the given fermionic operator to a qubits operator using the mapper’s configuration. |
| get_num_qubits | Gets the number of qubits after mapping the given problem into qubits space. |
Attributes:
| Name | Type | Description |
|---|
method | MappingMethod | The mapping method. |
method
method = method
map
map(
self: ,
fermion_op: FermionOperator,
args: Any = (),
kwargs: Any =
) -> QubitOperator
Maps the given fermionic operator to a qubits operator using the mapper’s
configuration.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
fermion_op | FermionOperator | A fermionic operator. | required |
args | Any | | () |
kwargs | Any | | |
Returns:
- Type:
QubitOperator
- The mapped qubits operator.
get_num_qubits
get_num_qubits(
self: ,
problem: FermionHamiltonianProblem
) -> int
Gets the number of qubits after mapping the given problem into qubits space.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
problem | FermionHamiltonianProblem | The fermion problem. | required |
Returns:
- Type:
int
- The number of qubits.
FermionHamiltonianProblem
Defines an electronic-structure problem using a Fermionic operator and electron count.
Can also be constructed from a MolecularData object using the from_molecule
method.
Methods:
| Name | Description |
|---|
| from_molecule | Constructs a FermionHamiltonianProblem from a molecule data. |
Attributes:
| Name | Type | Description |
|---|
fermion_hamiltonian | FermionOperator | The fermionic hamiltonian of the problem. Assumed to be in the block-spin labeling. |
n_orbitals | int | Number of spatial orbitals. |
n_alpha | int | Number of alpha particles. |
n_beta | int | Number of beta particles. |
n_particles | tuple[int, int] | Number of alpha and beta particles. |
fermion_hamiltonian
fermion_hamiltonian = fermion_hamiltonian
n_particles
n_particles = n_particles
n_orbitals
n_orbitals = min_n_orbitals
occupied_alpha
occupied_alpha: list[int]
virtual_alpha
virtual_alpha: list[int]
occupied_beta
occupied_beta: list[int]
virtual_beta
virtual_beta: list[int]
occupied
occupied: list[int]
virtual
virtual: list[int]
from_molecule
from_molecule(
cls: ,
molecule: MolecularData,
first_active_index: int = 0,
remove_orbitlas: Sequence[int] | None = None,
remove_orbitals: Sequence[int] | None = None,
op_compression_tol: float = 1e-13
) -> FermionHamiltonianProblem
Constructs a FermionHamiltonianProblem from a molecule data.
Parameters:
| Name | Type | Description | Default |
|---|
cls | “ | | required |
molecule | MolecularData | The molecule data. | required |
first_active_index | int | The first active index, indicates all prior indices are freezed. | 0 |
remove_orbitlas | Sequence[int] | None | | None |
remove_orbitals | Sequence[int] | None | Active indices to be removed. | None |
op_compression_tol | float | Tolerance for trimming the fermion operator. | 1e-13 |
Returns:
- Type:
FermionHamiltonianProblem
- The fermion hamiltonian problem.
get_hf_fermion_op
get_hf_fermion_op(
problem: FermionHamiltonianProblem
) -> FermionOperator
Constructs a fermion operator that creates the Hartree-Fock reference state in
block-spin ordering.
Parameters:
| Name | Type | Description | Default |
|---|
problem | FermionHamiltonianProblem | The fermion problem. The Hartree-Fock fermion operator depends only on the number of spatial orbitals and the number of alpha and beta particles. | required |
Returns:
- Type:
FermionOperator
- The Hartree-Fock fermion operator.
get_hf_state
get_hf_state(
problem: FermionHamiltonianProblem,
mapper: FermionToQubitMapper
) -> list[bool]
Computes the qubits state after applying the Hartree-Fock operator defined by the
given problem and mapper.
The Qmod function prepare_basis_state can be used on the returned value to
allocate and initialize the qubits array.
Parameters:
| Name | Type | Description | Default |
|---|
problem | FermionHamiltonianProblem | The fermion problem. | required |
mapper | FermionToQubitMapper | The mapper from fermion operator to qubits operator. | required |
Returns:
- Type:
list[bool]
- The qubits state, given as a list of boolean values for each qubit.
Members:
| Name | Description |
|---|
FermionToQubitMapper | Mapper between fermionic operators to qubits operators, using one of the supported mapping methods (see MappingMethod). |
FermionHamiltonianProblem | Defines an electronic-structure problem using a Fermionic operator and electron count. |
SparsePauliOp | Represents a collection of sparse Pauli operators. |
get_ucc_hamiltonians | Computes the UCC hamiltonians of the given problem in the desired excitations, using the given mapper. |
get_excitations | Gets all the possible excitations of the given problem according to the given number of excitations, preserving the particles spin. |
FermionToQubitMapper
Mapper between fermionic operators to qubits operators, using one of the supported
mapping methods (see MappingMethod).
Methods:
| Name | Description |
|---|
| map | Maps the given fermionic operator to a qubits operator using the mapper’s configuration. |
| get_num_qubits | Gets the number of qubits after mapping the given problem into qubits space. |
Attributes:
| Name | Type | Description |
|---|
method | MappingMethod | The mapping method. |
method
method = method
map
map(
self: ,
fermion_op: FermionOperator,
args: Any = (),
kwargs: Any =
) -> QubitOperator
Maps the given fermionic operator to a qubits operator using the mapper’s
configuration.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
fermion_op | FermionOperator | A fermionic operator. | required |
args | Any | | () |
kwargs | Any | | |
Returns:
- Type:
QubitOperator
- The mapped qubits operator.
get_num_qubits
get_num_qubits(
self: ,
problem: FermionHamiltonianProblem
) -> int
Gets the number of qubits after mapping the given problem into qubits space.
Parameters:
| Name | Type | Description | Default |
|---|
self | “ | | required |
problem | FermionHamiltonianProblem | The fermion problem. | required |
Returns:
- Type:
int
- The number of qubits.
FermionHamiltonianProblem
Defines an electronic-structure problem using a Fermionic operator and electron count.
Can also be constructed from a MolecularData object using the from_molecule
method.
Methods:
| Name | Description |
|---|
| from_molecule | Constructs a FermionHamiltonianProblem from a molecule data. |
Attributes:
| Name | Type | Description |
|---|
fermion_hamiltonian | FermionOperator | The fermionic hamiltonian of the problem. Assumed to be in the block-spin labeling. |
n_orbitals | int | Number of spatial orbitals. |
n_alpha | int | Number of alpha particles. |
n_beta | int | Number of beta particles. |
n_particles | tuple[int, int] | Number of alpha and beta particles. |
fermion_hamiltonian
fermion_hamiltonian = fermion_hamiltonian
n_particles
n_particles = n_particles
n_orbitals
n_orbitals = min_n_orbitals
occupied_alpha
occupied_alpha: list[int]
virtual_alpha
virtual_alpha: list[int]
occupied_beta
occupied_beta: list[int]
virtual_beta
virtual_beta: list[int]
occupied
occupied: list[int]
virtual
virtual: list[int]
from_molecule
from_molecule(
cls: ,
molecule: MolecularData,
first_active_index: int = 0,
remove_orbitlas: Sequence[int] | None = None,
remove_orbitals: Sequence[int] | None = None,
op_compression_tol: float = 1e-13
) -> FermionHamiltonianProblem
Constructs a FermionHamiltonianProblem from a molecule data.
Parameters:
| Name | Type | Description | Default |
|---|
cls | “ | | required |
molecule | MolecularData | The molecule data. | required |
first_active_index | int | The first active index, indicates all prior indices are freezed. | 0 |
remove_orbitlas | Sequence[int] | None | | None |
remove_orbitals | Sequence[int] | None | Active indices to be removed. | None |
op_compression_tol | float | Tolerance for trimming the fermion operator. | 1e-13 |
Returns:
- Type:
FermionHamiltonianProblem
- The fermion hamiltonian problem.
SparsePauliOp
Represents a collection of sparse Pauli operators.
Attributes:
| Name | Type | Description |
|---|
terms | CArray[SparsePauliTerm] | The list of chosen sparse Pauli terms, corresponds to a product of them. (See: SparsePauliTerm) |
num_qubits | CInt | The number of qubits in the Hamiltonian. |
terms
terms: list[SparsePauliTerm]
num_qubits
num_qubits: int
get_ucc_hamiltonians
get_ucc_hamiltonians(
problem: FermionHamiltonianProblem,
mapper: FermionToQubitMapper,
excitations: int | Sequence[int]
) -> list[SparsePauliOp]
Computes the UCC hamiltonians of the given problem in the desired excitations,
using the given mapper.
Parameters:
| Name | Type | Description | Default |
|---|
problem | FermionHamiltonianProblem | The fermion problem. | required |
mapper | FermionToQubitMapper | The mapper from fermion to qubits operators. | required |
excitations | int | Sequence[int] | A single desired excitation or an excitations list. | required |
Returns:
- Type:
list[SparsePauliOp]
- The UCC hamiltonians.
get_excitations
get_excitations(
problem: FermionHamiltonianProblem,
num_excitations: int
) -> set[tuple[tuple[int, …], tuple[int, …]]]
Gets all the possible excitations of the given problem according to the
given number of excitations, preserving the particles spin.
Parameters:
| Name | Type | Description | Default |
|---|
problem | FermionHamiltonianProblem | The fermion problem. | required |
num_excitations | int | Number of excitations. | required |
Returns:
- Type:
set[tuple[tuple[int, ...], tuple[int, ...]]]
- A set of all possible excitations, specified as a pair of source and target indices.