Chemically Aware Ansatz
Chemically aware ansatzes (FermionSpaceStateExpChemicallyAware
and
FermionSpaceAnsatzChemicallyAwareUCCSD
)
benefit from a special excitation regrouping strategy, aimed at reducing the two-qubit gate count.
The method consists of:
Regrouping excitations to arrange the spatial-to-spatial excitations in a consecutive sequence.
Mapping spatial-to-spatial excitations directly to a circuit, to reduce from 64 to 2 two-qubit gates per excitation. This also comes with an overhead of 2
CX
-gates per spatial orbital for all spatial orbitals used across all spatial-to-spatial excitations.Encoding spin-orbitals to qubits with Jordan–Wigner mapping.
Exploiting commuting sets of excitations in the Ansatz circuit synthesis.
For more details on the method please refer to [47].
The ansatz can be used similarly to other ansatzes in the UCC family. Once instances of FermionSpace
and
FermionState
(the occupation state corresponding to the reference) are available, the
FermionSpaceAnsatzChemicallyAwareUCCSD
can be instantiated in the same way as
FermionSpaceAnsatzUCCSD
:
from pytket.circuit import OpType
from inquanto.ansatzes import FermionSpaceAnsatzUCCSD, FermionSpaceAnsatzChemicallyAwareUCCSD
from inquanto.spaces import FermionSpace
from inquanto.states import FermionState
space = FermionSpace(8)
state = FermionState([1, 1, 0, 0, 0, 0, 0, 0])
ansatz = FermionSpaceAnsatzUCCSD(space, state)
chemically_aware_ansatz = FermionSpaceAnsatzChemicallyAwareUCCSD(space, state)
print(ansatz.state_circuit.depth_by_type(OpType.CX))
print(chemically_aware_ansatz.state_circuit.depth_by_type(OpType.CX))
187
156
The depth of the resulting state circuit of chemically_aware_ansatz
is smaller than that of ansatz
. However,
the user should be aware that the rearrangement of excitations may impact the Trotter error - either positively or negatively.
For even better circuit depth, reduction symmetry filtering is recommended. The H2 molecule in the
6-31g basis set can be used to exemplify the benefit of a symmetry aware FermionSpace
:
from inquanto.symmetry import PointGroup
point_group = PointGroup("D2h")
orb_irreps = ["Ag", "Ag", "B1u", "B1u", "Ag", "Ag", "B1u", "B1u"]
space_pg = FermionSpace(8, point_group=point_group, orb_irreps=orb_irreps)
ansatz = FermionSpaceAnsatzUCCSD(space_pg, state)
chemically_aware_ansatz = FermionSpaceAnsatzChemicallyAwareUCCSD(space_pg, state)
print(ansatz.state_circuit.depth_by_type(OpType.CX))
print(chemically_aware_ansatz.state_circuit.depth_by_type(OpType.CX))
96
62
The FermionSpaceStateExpChemicallyAware
class can be used for any sequence of single and double excitations in the same way as
FermionSpaceStateExp
, and it will give greater flexibility to compose an excitation list with more spatial-to-spatial excitations.