1
$\begingroup$

I have a task in an assignment that wants me to apply a Hamiltonian to a state. The Hamiltonial is 0.01*sigma_z. I know how to apply a Z gate to a state but I don't know to process the factor 0.01 in front of it.

Context: We want to implement a Trotterized adiabtaic quantum computing algorithim for one qubit and use the Laudau Zener Hamiltonian

$\endgroup$

2 Answers 2

2
$\begingroup$

If I got it well, to implement what you want in Qiskit you can do the following:

from qiskit import QuantumCircuit
from qiskit.circuit.library import ZGate
from qiskit.quantum_info import Operator
from qiskit.visualization import array_to_latex

k = 0.01
qc1 = QuantumCircuit(1)
h = ZGate().power(k)
qc1.append(h, [0])

array_to_latex(Operator(qc1))

$$ \begin{bmatrix} 1 & 0 \\ 0 & 0.99951 + 0.03141i \\ \end{bmatrix} $$

This will work in general, for any gate and any $k$ value. However, in your specific case, recalling that $Z = U(0, \pi, 0)$, a simple rotation works as well:

from numpy import pi

qc2 = QuantumCircuit(1)
qc2.u(theta=0, phi=pi*k, lam=0, qubit=0)

array_to_latex(Operator(qc2))

$$ \begin{bmatrix} 1 & 0 \\ 0 & 0.99951 + 0.03141i \\ \end{bmatrix} $$

$\endgroup$
2
$\begingroup$

I found the answer. The R_x and R_z gates do exactly that. Decomposing the Pauli Trotter Evolution funktion helped answer that.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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