0
$\begingroup$

I want the draw the quantum circuit of the following Hamiltonian: $$H = - 4 \times X\otimes X\otimes X\otimes X - 4\times Z\otimes Z\otimes Z \otimes Z$$. I have been able to draw the circuits of $ - X\otimes X\otimes X\otimes X$ and $- Z\otimes Z\otimes Z \otimes Z$. But adding them up using qiskit functions like compose, and combine did not give me the matrix I am looking for.

I would like to recall that when looking at $ 4 \times X\otimes X\otimes X\otimes X$ for instance, the operator $ X\otimes X\otimes X\otimes X$ will be applied $4$ times but not on the same set of qubits and the matrix should $16\times 16$. Using compose and combine function, I still obtain the $16\times 16$ matrix by its components do not add up. Instead, the gates acted on the same set of qubits.

It will be very helpful if someone can help me. Thanks

$\endgroup$
5
  • 1
    $\begingroup$ Can I suggest you switch notation? It might help make it clearly what you're asking for. For example, let $X_2$ be $I\otimes X\otimes I\otimes I\otimes\ldots\otimes I$, so you can write things like $X_1X_2X_3X_4$ as the operator you're talking about on the first 4 qubits. Now, what do you really mean by $4\times X\otimes X\otimes X\otimes X$? $\endgroup$
    – DaftWullie
    Oct 6 at 8:37
  • $\begingroup$ Yeah. But the $x_i$ are the same. There are x-Pauli matrices. The initial form of the Hamiltonian is $H = -\sum_v As - \sum_p Bp$ where $As = X\otimes ^4$ and $Bp = Z\otimes^4$. In my case, The sum contains 4 elements for both operator. $\endgroup$ Oct 6 at 8:46
  • $\begingroup$ Yes, but, as I understand it, the sets of 4 qubits are different for each term. This is the crucial thing that's missing from the question, and (I suspect) in what you're telling qiskit to do. $\endgroup$
    – DaftWullie
    Oct 6 at 9:47
  • $\begingroup$ The sets of the 4 qubits are differents. That is true. While applying the operators As and Bp on them, the circuit of each will be the same I think. My concern is how to add up all the circuits without using combine and compose functions $\endgroup$ Oct 6 at 10:11
  • $\begingroup$ Are you doing a Toric code(surface code) implementation? If so, you can check this answer: entangledquery.com/t/surface-code-implementation/23 $\endgroup$
    – Anna Hua
    Oct 15 at 23:55
0
$\begingroup$

One can start with operator flow's tutorial of qiskit which can be found on this website. The Hamiltonian can be easily found. But since it's not a unitary matrix, the qiskit functions won't be able to build its corresponding circuit.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.