I am trying to develop a customized VQE algorithm in which I am making use of the class UCC of qiskit_nature. I am having trouble understanding the outputs of the methods of the class. I have elaborated it below.
The UCC operator is given by, $U = e^{T-T^\dagger}$ where $T$ is the cluster operator. $T$ is written as a linear combination of excitation operators with respect to a reference state, say the HartreeFock state. It is a function of many parameters that act as coefficients of these excitation operators. First, I would like to obtain $U$, preferably in the form of a QuantumCircuit. I believe this is definitely achievable through the class UCC but I am having a little hard time trying to understand how, or trying to see what I have obtained is actually correct. Here is what I did.
I imported the relevant modules and called the UCC with num_orbitlas = 4 and num_particles = (1,1) as follows.
from qiskit_nature.circuit.library.ansatzes import UCC
from qiskit_nature.mappers.second_quantization import JordanWignerMapper
UCC_operator = UCC(qubit_converter=QubitConverter(mapper=JordanWignerMapper()), num_particles=(1,1), num_spin_orbitals=4, excitations='s')
Once I obtained the UCC_operator
object, I used the excitation_ops
method of the UCC class to extract the excitation operators. The code:
ferm_ops = UCC_operator.excitation_ops()
print (ferm_ops)
and the output:
[FermionicOp([('+-II', 1j), ('-+II', 1j)], register_length=4, display_format='dense'), FermionicOp([('II+-', 1j), ('II-+', 1j)], register_length=4, display_format='dense')]
My first two questions concern the form of the output of this particular method.
1. Does the above output correspond to the operator $T-T^\dagger$ in the exponential of the conventional UCC operator? If so, am I correct in saying that the above form basically implies $T-T^\dagger = t_0 (c_0^\dagger c_1 - c_1^\dagger c_0) + t_1 (c_2^\dagger c_3 - c_3^\dagger c_2)$ ? Where $t_0$ & $t_1$ are just some parameters although not present in the above output but I believe are still contained in the UCC_operator
.
2. Now, is it that the additional imaginary factor is multiplied to the above operators because Trotterization in qiskit somehow considers the evolution operators to be of the form $e^{-i\hat{O}}$ which for our case would be like $e^{-i\cdot i(T-T^{\dagger})}$ and hence the ferm_op
printed above actually corresponds to $i(T-T^{\dagger})$ and not just $T-T^{\dagger}$? (I saw in the source code of UCC that the sign is due to PauliTrotterEvolution.convert but I was not sure if this is what it meant.)
Now, I wanted to convert this operator from second quantized form to a Pauli string. I used the map method of the JordanWignerMapper as follows,
JW = JordanWignerMapper()
print ([JW.map(second_q_op=ferm_ops[i]) for i in range (len(ferm_ops))])
to obtain,
[PauliSumOp(SparsePauliOp(['IIXY', 'IIYX'], coeffs=[ 0.5+0.j, -0.5+0.j]), coeff=1.0), PauliSumOp(SparsePauliOp(['XYII', 'YXII'], coeffs=[ 0.5+0.j, -0.5+0.j]), coeff=1.0)]
3. Am I then correct in interpreting the above result to mean $i(T-T^{\dagger}) = 0.5\cdot t_0[IIXY - IIYX] + 0.5\cdot t_1[XYII - YXII]$ under the Jordan-Wigner transformation?
Finally, I drew the circuit using the following code:
UCC_operator.decompose().draw(output='mpl', filename='my_circuit.png')
The image seems to be of the Trotterized UCC anstaz with Trotter step = 1. This I believe is due to the reps
parameter of UCC which by default is equal to one. Then,
4. Why is there a "+" sign instead of a "-" sign between IIXY & IIYX and XYII & YXII in the above circuit if what I have written in question 3 is correct?
5. Also, are the factors of half present in the expression of question 3 are now absorbed in the constant parameters $t[0]$ and $t[1]$ given in the above circuit?
These are the questions I encountered while trying to understand the class UCC. Since I am trying to develop a modified VQE, it was essential for me to get these doubts clarified before heading on. Any hints or answers are greatly appreciated. Thank you.