5

I was wondering in how to interpret and represent the operator $e^{-i\theta(I-Z_1\otimes Z_2 \otimes Z_3)}$ for a 3 qubit system in a circuit using qiskit.

I was thinking I could just perform an individual $\theta$ degree rotation about each qubit Z axis but what about the identity? $e^{-i\theta I} = \begin{bmatrix} e^{-i \theta } & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & e^{-i\theta}& 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & e^{-i\theta} & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & e^{-i\theta} & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & e^{-i\theta} & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 &e^{-i\theta} & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 &e^{-i\theta} & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & e^{-i\theta} \end{bmatrix} $

I can construct this operator with the identity operator in 2 qubits and one identity with a global phase $e^{-i\theta}$. Isn't this just an identity with a global phase factor?

Davit Khachatryan
  • 4,461
  • 1
  • 11
  • 22

2 Answers2

5

We can't implement $e^{iZ_1 \otimes Z_2 \otimes Z_3 \theta}$ with three separate rotations. In other words:

$$e^{iZ_1 \otimes Z_2 \otimes Z_3 \theta} \ne e^{i Z_1 \theta} \otimes e^{i Z_2 \theta} \otimes e^{i Z_3 \theta}$$

The implementation of this gate can be found in this answer. The $e^{-iI \otimes I \otimes I\theta} = e^{-i\theta} I \otimes I \otimes I$ term is a global phase gate and can be ignored for the case described in the question.


An implementation with Qiskit:

from qiskit import *
from qiskit.aqua.operators import WeightedPauliOperator

theta = 1.7 pauli_dict = {'paulis': [{"coeff": {"imag": 0.0, "real": theta}, "label": "ZZZ"}, {"coeff": {"imag": 0.0, "real": -theta}, "label": "III"} ] } operator = WeightedPauliOperator.from_dict(pauli_dict) circuit = operator.evolve(evo_time=1).decompose() print(circuit)

The output:

q3_0: ──■─────────────────────────■──
      ┌─┴─┐                     ┌─┴─┐
q3_1: ┤ X ├──■───────────────■──┤ X ├
      └───┘┌─┴─┐┌─────────┐┌─┴─┐└───┘
q3_2: ─────┤ X ├┤ U1(3.4) ├┤ X ├─────
           └───┘└─────────┘└───┘     

That coincides with the ideas discussed in this answer ($u1$ and $R_z$ gates are different just by a global phase). Note, that here $e^{-iI\theta}$ is a global phase and can be neglected (as was done in the circuit). However, as was discussed in this answer the controlled-$e^{-i I \theta}$ should be implemented if one needs to construct controlled-$e^{-i H \theta}$, where $H$ is a sum of tensor product terms of Pauli matrices with real coefficients (like $H = I - Z\otimes Z\otimes Z$ in the question's example) and one of the terms is $I$. Also, note that the code presented above works only for such $H$ whose terms commute. For more general cases one should also specify the rest of the arguments of the evolve method in order to implement for example first-order Trotter decomposition.

Davit Khachatryan
  • 4,461
  • 1
  • 11
  • 22
3

You're right, that this factor can be separated as an operation that applies a global phase factor. Matrix exponentiation is distributive over an additive argument if and and only if the additive terms commute. The identity operator and the scalar $-i\theta$, which can incidentally be though of as a constant of the gate design, commute with all unitary gates. Hence, we can think of this as the application of two gates, $e^{-i\theta I}$ and $e^{i\theta Z_1 Z_2 Z_3}$, to the quantum register in either order of application, applied by successive left multiplication on the initial quantum register "ket" in this case, from rightmost term.

Further, a global phase factor does not change the expectation values of Hermitian observables. Hence, I can think of no physically measurable reason this factor need not be dropped entirely from the circuit, (except classical simulator bookkeeping).

However, if this operator is controlled by any number of control qubits, disjoint from the set enumerated by your $Z_n$ operators, then the application of the phase factor is logically conditioned on these control bits being "true." Since the phase factor wouldn't be applied to basis states where the control bits are "false," the phase factor would no longer be "global" in that case, (i.e. equal down the diagonal of the operator matrix,) and the phase factor then affects Hermitian expectation values, and it must be included. The phase factor still commutes with your $Z_n$ operators, though, so your matrix exponentiation still distributes.

Dan Strano
  • 91
  • 3