quri_parts.chem.transforms package#
- class quri_parts.chem.transforms.FermionCreationTerm(indices: Sequence[int], coef: complex = 1.0)#
Bases:
object
Represents a term for creating a single Fermionic Fock state with a coefficient.
indices
specify indices of occupied spin orbitals. The orbitals should be indexed in an alternating order of up and down spins (especially important when using symmetry-conserving Bravyi-Kitaev mapping). The order of indices inindices
corresponds to the order of Fermionic creation operators. Therefore this class also contains information about a sign coming from ordering of creation operators.
- quri_parts.chem.transforms.FermionQubitStateMapper#
Interface for a function that maps a collection of occupied spin orbital indices to a computational basis state of qubits. Note that the mapping does not depend on the order of the occupied indices. A computational basis state with a positive sign should always be returned.
alias of
Callable
[[Collection
[int
]],ComputationalBasisState
]
- quri_parts.chem.transforms.QubitFermionStateMapper#
Interface for a function that maps a computational basis state of qubits to a collection of occupied spin orbital indices.
alias of
Callable
[[ComputationalBasisState
],Collection
[int
]]
- class quri_parts.chem.transforms.FermionQubitMapping(*args, **kwargs)#
Bases:
Protocol
Mapping from Fermionic states to qubit states.
- abstract n_qubits_required(n_spin_orbitals: int) int #
Returns a number of qubits the mapping requires for a given number of spin orbitals.
- abstract n_spin_orbitals(n_qubits: int) int #
Returns a number of spin orbitals that the mapping can represent with a given number of qubits.
- abstract get_state_mapper(n_spin_orbitals: int, n_fermions: int | None = None) Callable[[Collection[int]], ComputationalBasisState] #
Returns a function that maps occupied spin orbital indices to a computational basis state of qubits.
- Parameters:
n_spin_orbitals – The number of spin orbitals to be mapped to qubits.
n_fermions – When specified, restrict the mapping to a subspace spanned by states containing the fixed number of Fermions. Some mappings require this argument (e.g. symmetry-conserving Bravyi-Kitaev transformation) while the others ignore it.
- abstract get_inv_state_mapper(n_spin_orbitals: int, n_fermions: int | None = None, n_up_spins: int | None = None) Callable[[ComputationalBasisState], Collection[int]] #
Returns a function that maps a computational basis state of qubits to the set of occupied spin orbital indices.
- Parameters:
n_spin_orbitals – The number of spin orbitals.
n_fermions – The number of fermions considered when the qubit state is mapped. Some mappings require this argument (e.g. symmetry-conserving Bravyi-Kitaev transformation) while the others ignore it.
n_up_spins – The number of spin-up electrons.
- class quri_parts.chem.transforms.JordanWigner(*args, **kwargs)#
Bases:
FermionQubitMapping
,ABC
Jordan-Wigner transformation.
- n_qubits_required(n_spin_orbitals: int) int #
Returns a number of qubits the mapping requires for a given number of spin orbitals.
- n_spin_orbitals(n_qubits: int) int #
Returns a number of spin orbitals that the mapping can represent with a given number of qubits.
- class quri_parts.chem.transforms.BravyiKitaev(*args, **kwargs)#
Bases:
FermionQubitMapping
,ABC
Bravyi-Kitaev transformation.
- n_qubits_required(n_spin_orbitals: int) int #
Returns a number of qubits the mapping requires for a given number of spin orbitals.
- n_spin_orbitals(n_qubits: int) int #
Returns a number of spin orbitals that the mapping can represent with a given number of qubits.
- class quri_parts.chem.transforms.SymmetryConservingBravyiKitaev(*args, **kwargs)#
Bases:
FermionQubitMapping
,ABC
Symmetry-conserving Bravyi-Kitaev transformation described in arXiv:1701.08213.
Note that in this mapping the spin orbital indices are first reordered to all spin-up orbitals, then all spin-down orbitals. Bravyi-Kitaev transoformation is applied after the reordering and then two qubits are dropped using conservation of particle number and spin.
- n_qubits_required(n_spin_orbitals: int) int #
Returns a number of qubits the mapping requires for a given number of spin orbitals.
- n_spin_orbitals(n_qubits: int) int #
Returns a number of spin orbitals that the mapping can represent with a given number of qubits.