BasisTransformer#

class BasisTransformer(initial_basis, final_basis, coefficients)[ソース]#

ベースクラス: BaseTransformer

A transformer to map from one basis to another.

Since problems have a basis associated with them (e.g. the qiskit_nature.second_q.problems.ElectronicBasis in the case of the qiskit_nature.second_q.problems.ElectronicStructureProblem), this transformer can be used to map from one initial_basis to another final_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.

パラメータ:

Methods

invert()[ソース]#

Invert the transformer to do the reversed transformation.

戻り値:

A new BasisTransformer mapping from final_basis to initial_basis.

戻り値の型:

BasisTransformer

transform(problem)[ソース]#

Transforms one BaseProblem into 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.

戻り値の型:

BaseProblem

transform_electronic_integrals(integrals)[ソース]#

Transforms an qiskit_nature.second_q.operators.ElectronicIntegrals instance.

パラメータ:

integrals (ElectronicIntegrals) – the ElectronicIntegrals to transform.

例外:

QiskitNatureError – when using this method on a BasisTransformer that does not store its coefficients as ElectronicIntegrals, too.

戻り値:

The transformed ElectronicIntegrals.

戻り値の型:

ElectronicIntegrals

transform_hamiltonian(hamiltonian)[ソース]#

Transforms one Hamiltonian into 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