ElectronicStructureProblem#
- class ElectronicStructureProblem(hamiltonian)[fuente]#
Bases:
BaseProblem
The Electronic Structure Problem.
This class represents the problem of the electronic Schrödinger equation:
\[\hat{H_{el}}|\Psi\rangle = E_{el}|\Psi\rangle,\]where \(\hat{H_{el}}\) is the
qiskit_nature.second_q.hamiltonians.ElectronicEnergy
hamiltonian, \(\Psi\) is the wave function of the system and \(E_{el}\) is the eigenvalue. When passed to aqiskit_nature.second_q.algorithms.GroundStateSolver
, you will be solving for the ground-state energy, \(E_0\).This class has various attributes (see below) which allow you to add additional information about the problem which you are trying to solve, which can be used by various modules in the stack. For example, specifying the number of particles in the system
num_particles
is useful (and even required) for many components that interact with this problem instance to make your life easier (for example theqiskit_nature.second_q.transformers.ActiveSpaceTransformer
).In the fermionic case the default filter ensures that the number of particles is being preserved.
Nota
The default filter_criterion assumes a singlet spin configuration. This means, that the number of alpha-spin electrons is equal to the number of beta-spin electrons. If the
AngularMomentum
property is available, one can correctly filter a non-singlet spin configuration with a custom filter_criterion similar to the following:import numpy as np from qiskit_algorithms import NumPyMinimumEigensolver expected_spin = 2 expected_num_electrons = 6 def filter_criterion_custom(eigenstate, eigenvalue, aux_values): num_particles_aux = aux_values["ParticleNumber"][0] total_angular_momentum_aux = aux_values["AngularMomentum"][0] return ( np.isclose(total_angular_momentum_aux, expected_spin) and np.isclose(num_particles_aux, expected_num_electrons) ) solver = NumPyEigensolver() solver.filter_criterion = filter_criterion_custom
The following attributes can be read and updated once the
ElectronicStructureProblem
object has been constructed.- properties#
a container for additional observable operator factories.
- molecule#
a container for molecular system data.
- Type:
MoleculeInfo | None
- basis#
the electronic basis of all contained orbital coefficients.
- Type:
ElectronicBasis | None
- num_spatial_orbitals#
the number of spatial orbitals in the system.
- orbital_energies#
the energy values of the alpha-spin orbitals.
- Type:
np.ndarray | None
- orbital_energies_b#
the energy values of the beta-spin orbitals.
- Type:
np.ndarray | None
- Parámetros:
hamiltonian (ElectronicEnergy) – the Hamiltonian of this problem.
Attributes
- hamiltonian#
- nuclear_repulsion_energy#
The nuclear repulsion energy.
See
qiskit_nature.second_q.hamiltonians.ElectronicEnergy.nuclear_repulsion_energy
for more details.
- num_alpha#
The number of alpha-spin particles.
- num_beta#
The number of beta-spin particles.
- num_particles#
The number of particles in alpha- and beta-spin.
- num_spin_orbitals#
The total number of spin orbitals.
- orbital_occupations#
The occupations of the alpha-spin orbitals.
- orbital_occupations_b#
The occupations of the beta-spin orbitals.
Methods
- get_default_filter_criterion()[fuente]#
Returns a default filter criterion method to filter the eigenvalues computed by the eigensolver. For more information see also
filter_criterion()
.This particular default ensures that the total number of particles is conserved and that the angular momentum (if computed) evaluates to 0.
- get_tapered_mapper(mapper)#
Builds a
TaperedQubitMapper
from one of the mappers. This simplifies the identification of the Pauli operator symmetries and of the symmetry sector in which lies the solution of the problem.- Parámetros:
mapper (QubitMapper) –
QubitMapper
object implementing the mapping of second quantized operators to Pauli operators.- Muestra:
ValueError – If the mapper is a
TaperedQubitMapper
.- Devuelve:
A
TaperedQubitMapper
with pre-built symmetry specifications.- Tipo del valor devuelto:
- interpret(raw_result)[fuente]#
Interprets an EigenstateResult in the context of this problem.
- Parámetros:
raw_result (EigenstateResult | EigensolverResult | MinimumEigensolverResult) – an eigenstate result object.
- Devuelve:
An electronic structure result.
- Tipo del valor devuelto:
- second_q_ops()#
Returns the second quantized operators associated with this problem.
- Devuelve:
A tuple, with the first object being the main operator and the second being a dictionary of auxiliary operators.
- Tipo del valor devuelto:
tuple[qiskit_nature.second_q.operators.sparse_label_op.SparseLabelOp, dict[str, qiskit_nature.second_q.operators.sparse_label_op.SparseLabelOp]]