FreezeCoreTransformer#

class FreezeCoreTransformer(freeze_core=True, remove_orbitals=None)[ソース]#

ベースクラス: BaseTransformer

The Freeze-Core reduction.

This transformation is mathematically identical to the ActiveSpaceTransformer. The difference arises in the user interface: while you configure the _active_ components in the other transformer, here you configure the _inactive_ components. For more information on the configuration options please refer to the input argument description further below and for more information on the mathematical transformation refer to the documentation of the ActiveSpaceTransformer.

If you want to apply this transformer to a Hamiltonian outside of a Problem instance, you need to prepare the active space by providing the molecular system information which your Hamiltonian corresponds to which would normally be extracted from the Problem object. You can do this like so:

# assuming you have the total Hamiltonian of your system available:
total_hamiltonian = ElectronicEnergy(...)

# now you want to apply the freeze-core reduction
transformer = FreezeCoreTransformer()

# since the FreezeCoreTransformer requires molecular system information,
# you need to create that data structure like so:
molecule = MoleculeInfo(
    symbols=["Li", "H"],
    coords=[(0.0, 0.0, 0.0), (0.0, 0.0, 1.6)],
)
# and since the system size depends on the basis set, you need to provide
# the total number of spatial orbitals separately:
total_num_spatial_orbitals = 11  # e.g. the 6-31g basis

# this allows you to prepare the active space correctly like so:
transformer.prepare_active_space(molecule, total_num_spatial_orbitals)

# after preparation, you can now transform only your Hamiltonian like so
reduced_hamiltonian = transformer.transform_hamiltonian(total_hamiltonian)

Initializes a transformer which can reduce an ElectronicStructureProblem to a configured active space.

The orbitals to be removed are specified in two ways:

  1. When freeze_core is enabled (the default), the 「core」 orbitals will be determined automatically according to count_core_orbitals. These will then be made inactive and removed in the same fashion as in the ActiveSpaceTransformer.

  2. Additionally, unoccupied spatial orbitals can be removed via a list of indices passed to remove_orbitals. It is the user’s responsibility to ensure that these are indeed unoccupied orbitals, as no checks are performed.

If you want to remove additional occupied orbitals, please use the ActiveSpaceTransformer instead.

パラメータ:
  • freeze_core (bool) – A boolean indicating whether to remove the 「core」 orbitals.

  • remove_orbitals (list[int] | None) – A list of indices specifying spatial orbitals which are removed. No checks are performed on the nature of these orbitals, so the user must make sure that these are _unoccupied_ orbitals, which can be removed without taking any energy shifts into account.

Methods

Z(atom)[ソース]#

Atomic Number (Z) of an atom.

パラメータ:

atom (str) – the atom kind (symbol) whose atomic number to return.

戻り値:

The atomic number of the queried atom kind.

戻り値の型:

int

count_core_orbitals(atoms)[ソース]#

Counts the number of core orbitals in a list of atoms.

パラメータ:

atoms (Sequence[str]) – the list of atoms.

戻り値:

The number of core orbitals.

戻り値の型:

int

prepare_active_space(molecule, total_num_spatial_orbitals, *, occupation_alpha=None, occupation_beta=None)[ソース]#

Prepares the active space.

This method must be called manually when using this transformer on a hamiltonian outside of a problem instance. In all other cases, the information required here is extracted from the problem automatically.

パラメータ:
  • molecule (MoleculeInfo) – the molecular system information to which the hamiltonian belongs. From this, the involved atomic species and number of electrons will be extracted.

  • total_num_spatial_orbitals (int) – the total number of spatial orbitals in the system represented by the hamiltonian which is to be transformed.

  • occupation_alpha (list[float] | ndarray | None) – the occupation of the alpha-spin orbitals. If omitted, this information is inferred from the required arguments.

  • occupation_beta (list[float] | ndarray | None) – the occupation of the beta-spin orbitals. If omitted, this information is inferred from the required arguments.

transform(problem)[ソース]#

Transforms one BaseProblem into another.

パラメータ:

problem (BaseProblem) – the problem to be transformed.

例外:
戻り値:

A new BaseProblem instance.

戻り値の型:

BaseProblem

transform_hamiltonian(hamiltonian)[ソース]#

Transforms one Hamiltonian into another.

パラメータ:

hamiltonian (Hamiltonian) – the hamiltonian to be transformed.

例外:
戻り値:

A new Hamiltonian instance.

戻り値の型:

Hamiltonian