Skip to main content
Members:
NameDescription
FermionHamiltonianProblemDefines 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:
NameDescription
from_moleculeConstructs a FermionHamiltonianProblem from a molecule data.
Attributes:
NameTypeDescription
fermion_hamiltonianFermionOperatorThe fermionic hamiltonian of the problem. Assumed to be in the block-spin labeling.
n_orbitalsintNumber of spatial orbitals.
n_alphaintNumber of alpha particles.
n_betaintNumber of beta particles.
n_particlestuple[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:
NameTypeDescriptionDefault
clsrequired
moleculeMolecularDataThe molecule data.required
first_active_indexintThe first active index, indicates all prior indices are freezed.0
remove_orbitlasSequence[int] | NoneNone
remove_orbitalsSequence[int] | NoneActive indices to be removed.None
op_compression_tolfloatTolerance for trimming the fermion operator.1e-13
Returns:
  • Type: FermionHamiltonianProblem
  • The fermion hamiltonian problem. Members:
NameDescription
FermionHamiltonianProblemDefines an electronic-structure problem using a Fermionic operator and electron count.
MappingMethodMapping methods from fermionic operators to qubits operators.
FermionToQubitMapperMapper 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:
NameDescription
from_moleculeConstructs a FermionHamiltonianProblem from a molecule data.
Attributes:
NameTypeDescription
fermion_hamiltonianFermionOperatorThe fermionic hamiltonian of the problem. Assumed to be in the block-spin labeling.
n_orbitalsintNumber of spatial orbitals.
n_alphaintNumber of alpha particles.
n_betaintNumber of beta particles.
n_particlestuple[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:
NameTypeDescriptionDefault
clsrequired
moleculeMolecularDataThe molecule data.required
first_active_indexintThe first active index, indicates all prior indices are freezed.0
remove_orbitlasSequence[int] | NoneNone
remove_orbitalsSequence[int] | NoneActive indices to be removed.None
op_compression_tolfloatTolerance for trimming the fermion operator.1e-13
Returns:
  • Type: FermionHamiltonianProblem
  • The fermion hamiltonian problem.

MappingMethod

Mapping methods from fermionic operators to qubits operators. Attributes:
NameTypeDescription
JORDAN_WIGNER
BRAVYI_KITAEV

JORDAN_WIGNER

JORDAN_WIGNER = 'jw'

BRAVYI_KITAEV

BRAVYI_KITAEV = 'bk'

FermionToQubitMapper

Mapper between fermionic operators to qubits operators, using one of the supported mapping methods (see MappingMethod). Methods:
NameDescription
mapMaps the given fermionic operator to a qubits operator using the mapper’s configuration.
get_num_qubitsGets the number of qubits after mapping the given problem into qubits space.
Attributes:
NameTypeDescription
methodMappingMethodThe 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:
NameTypeDescriptionDefault
selfrequired
fermion_opFermionOperatorA fermionic operator.required
argsAny()
kwargsAny
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:
NameTypeDescriptionDefault
selfrequired
problemFermionHamiltonianProblemThe fermion problem.required
Returns:
  • Type: int
  • The number of qubits. Members:
NameDescription
FermionToQubitMapperMapper between fermionic operators to qubits operators, using one of the supported mapping methods (see MappingMethod).
MappingMethodMapping methods from fermionic operators to qubits operators.
FermionHamiltonianProblemDefines an electronic-structure problem using a Fermionic operator and electron count.
Z2SymTaperMapperMapper 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:
NameDescription
mapMaps the given fermionic operator to a qubits operator using the mapper’s configuration.
get_num_qubitsGets the number of qubits after mapping the given problem into qubits space.
Attributes:
NameTypeDescription
methodMappingMethodThe 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:
NameTypeDescriptionDefault
selfrequired
fermion_opFermionOperatorA fermionic operator.required
argsAny()
kwargsAny
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:
NameTypeDescriptionDefault
selfrequired
problemFermionHamiltonianProblemThe fermion problem.required
Returns:
  • Type: int
  • The number of qubits.

MappingMethod

Mapping methods from fermionic operators to qubits operators. Attributes:
NameTypeDescription
JORDAN_WIGNER
BRAVYI_KITAEV

JORDAN_WIGNER

JORDAN_WIGNER = 'jw'

BRAVYI_KITAEV

BRAVYI_KITAEV = 'bk'

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:
NameDescription
from_moleculeConstructs a FermionHamiltonianProblem from a molecule data.
Attributes:
NameTypeDescription
fermion_hamiltonianFermionOperatorThe fermionic hamiltonian of the problem. Assumed to be in the block-spin labeling.
n_orbitalsintNumber of spatial orbitals.
n_alphaintNumber of alpha particles.
n_betaintNumber of beta particles.
n_particlestuple[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:
NameTypeDescriptionDefault
clsrequired
moleculeMolecularDataThe molecule data.required
first_active_indexintThe first active index, indicates all prior indices are freezed.0
remove_orbitlasSequence[int] | NoneNone
remove_orbitalsSequence[int] | NoneActive indices to be removed.None
op_compression_tolfloatTolerance 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:
NameDescription
set_sectorSets the symmetry sector coefficients.
mapMaps 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_qubitsGets the number of qubits after mapping the given problem into qubits space.
from_problemInitializes a Z2SymTaperMapper object from a fermion problem (i.e.
Attributes:
NameTypeDescription
methodMappingMethodThe mapping method.
generatorstuple[QubitOperator, ...]Generators representing the Z2 symmetries.
x_opstuple[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:
NameTypeDescriptionDefault
selfrequired
sectorSequence[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:
NameTypeDescriptionDefault
selfrequired
fermion_opFermionOperatorA fermionic operator.required
argsAny()
is_invariantboolIf False, the operator is not necessarily in the symmetry subspace, and thus gets projected onto it before tapering.False
kwargsAny
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:
NameTypeDescriptionDefault
selfrequired
problemFermionHamiltonianProblemThe 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:
NameTypeDescriptionDefault
clsrequired
problemFermionHamiltonianProblemThe fermion problem.required
methodMappingMethodThe mapping method.MappingMethod.JORDAN_WIGNER
sector_from_hartree_fockboolWhether to compute the symmetry sector coefficients according to the Hartree-Fock state.True
tolfloatTolerance for trimming off terms.1e-14
Returns:
  • Type: Z2SymTaperMapper
  • The Z2 symmetries taper mapper. Members:
NameDescription
FermionToQubitMapperMapper between fermionic operators to qubits operators, using one of the supported mapping methods (see MappingMethod).
FermionHamiltonianProblemDefines an electronic-structure problem using a Fermionic operator and electron count.
get_hf_fermion_opConstructs a fermion operator that creates the Hartree-Fock reference state in block-spin ordering.
get_hf_stateComputes 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:
NameDescription
mapMaps the given fermionic operator to a qubits operator using the mapper’s configuration.
get_num_qubitsGets the number of qubits after mapping the given problem into qubits space.
Attributes:
NameTypeDescription
methodMappingMethodThe 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:
NameTypeDescriptionDefault
selfrequired
fermion_opFermionOperatorA fermionic operator.required
argsAny()
kwargsAny
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:
NameTypeDescriptionDefault
selfrequired
problemFermionHamiltonianProblemThe 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:
NameDescription
from_moleculeConstructs a FermionHamiltonianProblem from a molecule data.
Attributes:
NameTypeDescription
fermion_hamiltonianFermionOperatorThe fermionic hamiltonian of the problem. Assumed to be in the block-spin labeling.
n_orbitalsintNumber of spatial orbitals.
n_alphaintNumber of alpha particles.
n_betaintNumber of beta particles.
n_particlestuple[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:
NameTypeDescriptionDefault
clsrequired
moleculeMolecularDataThe molecule data.required
first_active_indexintThe first active index, indicates all prior indices are freezed.0
remove_orbitlasSequence[int] | NoneNone
remove_orbitalsSequence[int] | NoneActive indices to be removed.None
op_compression_tolfloatTolerance 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:
NameTypeDescriptionDefault
problemFermionHamiltonianProblemThe 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:
NameTypeDescriptionDefault
problemFermionHamiltonianProblemThe fermion problem.required
mapperFermionToQubitMapperThe 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:
NameDescription
FermionToQubitMapperMapper between fermionic operators to qubits operators, using one of the supported mapping methods (see MappingMethod).
FermionHamiltonianProblemDefines an electronic-structure problem using a Fermionic operator and electron count.
SparsePauliOpRepresents a collection of sparse Pauli operators.
get_ucc_hamiltoniansComputes the UCC hamiltonians of the given problem in the desired excitations, using the given mapper.
get_excitationsGets 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:
NameDescription
mapMaps the given fermionic operator to a qubits operator using the mapper’s configuration.
get_num_qubitsGets the number of qubits after mapping the given problem into qubits space.
Attributes:
NameTypeDescription
methodMappingMethodThe 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:
NameTypeDescriptionDefault
selfrequired
fermion_opFermionOperatorA fermionic operator.required
argsAny()
kwargsAny
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:
NameTypeDescriptionDefault
selfrequired
problemFermionHamiltonianProblemThe 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:
NameDescription
from_moleculeConstructs a FermionHamiltonianProblem from a molecule data.
Attributes:
NameTypeDescription
fermion_hamiltonianFermionOperatorThe fermionic hamiltonian of the problem. Assumed to be in the block-spin labeling.
n_orbitalsintNumber of spatial orbitals.
n_alphaintNumber of alpha particles.
n_betaintNumber of beta particles.
n_particlestuple[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:
NameTypeDescriptionDefault
clsrequired
moleculeMolecularDataThe molecule data.required
first_active_indexintThe first active index, indicates all prior indices are freezed.0
remove_orbitlasSequence[int] | NoneNone
remove_orbitalsSequence[int] | NoneActive indices to be removed.None
op_compression_tolfloatTolerance for trimming the fermion operator.1e-13
Returns:
  • Type: FermionHamiltonianProblem
  • The fermion hamiltonian problem.

SparsePauliOp

Represents a collection of sparse Pauli operators. Attributes:
NameTypeDescription
termsCArray[SparsePauliTerm]The list of chosen sparse Pauli terms, corresponds to a product of them. (See: SparsePauliTerm)
num_qubitsCIntThe 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:
NameTypeDescriptionDefault
problemFermionHamiltonianProblemThe fermion problem.required
mapperFermionToQubitMapperThe mapper from fermion to qubits operators.required
excitationsint | 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:
NameTypeDescriptionDefault
problemFermionHamiltonianProblemThe fermion problem.required
num_excitationsintNumber 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.