BasisTransformer#
- class BasisTransformer(initial_basis, final_basis, coefficients)[source]#
Bases:
BaseTransformerA transformer to map from one basis to another.
Since problems have a basis associated with them (e.g. the
qiskit_nature.second_q.problems.ElectronicBasisin the case of theqiskit_nature.second_q.problems.ElectronicStructureProblem), this transformer can be used to map from oneinitial_basisto anotherfinal_basis.For example, this is how you can create an AO-to-MO transformer for an
qiskit_nature.second_q.problems.ElectronicStructureProblem:# assuming you have the transformation coefficients from somewhere ao2mo_coeff, ao2mo_coeff_b = ... from qiskit_nature.second_q.operators import ElectronicIntegrals from qiskit_nature.second_q.problems import ElectronicBasis from qiskit_nature.second_q.transformers import BasisTransformer transformer = BasisTransformer( ElectronicBasis.AO, ElectronicBasis.MO, ElectronicIntegrals.from_raw_integrals(ao2mo_coeff, h1_b=ao2mo_coeff_b), ) problem_MO = transformer.transform(problem_AO)
- initial_basis#
the initial basis from which to map away from.
- final_basis#
the final basis into which to map into.
- coefficients#
the coefficients which transform from the initial to the final basis.
- প্যারামিটার:
initial_basis (ElectronicBasis) -- the initial basis from which to map away from.
final_basis (ElectronicBasis) -- the final basis into which to map into.
coefficients (PolynomialTensor | ElectronicIntegrals) -- the coefficients which transform from the initial to the final basis.
Methods
- invert()[source]#
Invert the transformer to do the reversed transformation.
- রিটার্নস:
A new
BasisTransformermapping fromfinal_basistoinitial_basis.- রিটার্ন টাইপ:
- transform(problem)[source]#
Transforms one
BaseProbleminto another. This may affect the size of the Hilbert space.- প্যারামিটার:
problem (BaseProblem) -- the problem to be transformed.
- রেইজেস:
NotImplementedError -- when an unsupported problem type is provided.
- রিটার্নস:
A new BaseProblem instance.
- রিটার্ন টাইপ:
- transform_electronic_integrals(integrals)[source]#
Transforms an
qiskit_nature.second_q.operators.ElectronicIntegralsinstance.- প্যারামিটার:
integrals (ElectronicIntegrals) -- the
ElectronicIntegralsto transform.- রেইজেস:
QiskitNatureError -- when using this method on a
BasisTransformerthat does not store itscoefficientsasElectronicIntegrals, too.- রিটার্নস:
The transformed
ElectronicIntegrals.- রিটার্ন টাইপ:
- transform_hamiltonian(hamiltonian)[source]#
Transforms one
Hamiltonianinto another. This may affect the size of the Hilbert space.- প্যারামিটার:
hamiltonian (Hamiltonian) -- the hamiltonian to be transformed.
- রেইজেস:
NotImplementedError -- when an unsupported hamiltonian type is provided.
- রিটার্নস:
A new Hamiltonian instance.
- রিটার্ন টাইপ:
Hamiltonian