Hi, my question it’s pretty simple, I want to know if its possible to change the active space when we call one of the dataset hamiltonian’s or it have a fixed structure (complete active space)?
Thanks in advance and have a nice day.
Hey @jnorambu!
Great question. I think this is something we’d like to have on https://pennylane.ai in the future, but for now the active space of molecules is hard-coded. This is the bit in the source code that’s relevant:
if mol.n_orbitals <= 40:
prog_bar.set_description("Hamiltonian Generation")
hamiltonian, qubits = qml.qchem.molecular_hamiltonian(
symbols,
geometry,
charge=charge,
basis=basis_name,
method="pyscf",
)
active_electrons = mol.n_electrons
active_orbitals = mol.n_orbitals
else:
# TODO: Add support for active orbitals in the Molecule class
core_orbs = core_orbitals(mol)
active_electrons = mol.n_electrons - 2 * len(core_orbs)
active_orbitals = mol.n_orbitals - len(core_orbs)
hamiltonian, qubits = qml.qchem.molecular_hamiltonian(
symbols,
geometry,
charge=charge,
method="pyscf",
active_electrons=active_electrons,
active_orbitals=active_orbitals,
)
For now, you can modify this if you’d like by cloning the source code repository and setting the active space to your liking . Let me know if this helps!
1 Like