In exercise 5 of the this year's IBM Quantum Challenge, you need to use the FreezeCoreTransformer
(along two_qubit_reduction
and z2symmetry_reduction
) to reduce the number of qubits to 4 and achieve a cost of 3. I managed to figure out that the optimal array to pass to the remove_orbitals
parameter was [3,4]
; however, I did this by experimenting with different arrays.
In the Qiskit slack, I saw that the one body integrals of the QMolecule
are supposed to give you an insight on which orbitals to freeze. However, they didn't explain how to use it to figure this out.
The molecule and one body integrals I am working with is the following.
molecule = 'Li 0.0 0.0 0.0; H 0.0 0.0 1.5474'
driver = PySCFDriver(atom=molecule)
qmolecule = driver.run()
Matrix(np.round(qmolecule.one_body_integrals, 10))
$$ \displaystyle \left[\begin{array}{cccccccccccc}-4.7385372413 & 0.1075391382 & 0.1675852953 & 0.0 & 0.0 & -0.0302628413 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.1075391382 & -1.5131757719 & 0.0343466943 & 0.0 & 0.0 & -0.0680291694 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.1675852953 & 0.0343466943 & -1.1291622926 & 0.0 & 0.0 & 0.031432226 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & -1.1407709359 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & -1.1407709359 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\-0.0302628413 & -0.0680291694 & 0.031432226 & 0.0 & 0.0 & -0.9418187042 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & -4.7385372413 & 0.1075391382 & 0.1675852953 & 0.0 & 0.0 & -0.0302628413\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.1075391382 & -1.5131757719 & 0.0343466943 & 0.0 & 0.0 & -0.0680291694\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.1675852953 & 0.0343466943 & -1.1291622926 & 0.0 & 0.0 & 0.031432226\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & -1.1407709359 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & -1.1407709359 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & -0.0302628413 & -0.0680291694 & 0.031432226 & 0.0 & 0.0 & -0.9418187042\end{array}\right] $$
How am I supposed to interpret this matrix to know which orbitals to freeze?
problem = ElectronicStructureProblem(driver, [FreezeCoreTransformer(remove_orbitals=[3,4])])
. I guess I'm missing the part in which the guy in the lab usesfreeze=[0,6]
in the video. However, my understanding is that this is done whenfreeze_core=True
(the default); is this right? – epelaez Jun 07 '21 at 15:54qiskit.chemistry
and notqiskit_nature
- similar methods, slightly different behavior. Also, read the documentation onFreezeCoreTransformer
: 1) whenfreeze_core
is enabled, the core orbitals listed in the QMolecule are made inactive and removed; 2) additionally, unoccupied molecular orbitals can be removed via a list of indices passed toremove_orbitals
. – João Galego Jun 07 '21 at 16:24