from qiskit import QuantumCircuit
import sys

sys.path.append("..")
from clonk.utils.riswap_gates.riswap import RiSwapGate

qc = QuantumCircuit(3)
# qc.u(0, 0, 0,0)
# qc.u(0, 0, 0,1)
# qc.append(RiSwapGate(0.5), [0,1])
# qc.u(0, 0, 0,0)
# qc.u(0, 0, 0,1)
# qc.append(RiSwapGate(0.5), [0,1])
# qc.u(0, 0, 0,0)
# qc.u(0, 0, 0,1)
qc.cswap(2, 0, 1)

qc.cswap(1, 0, 2)
qc.swap(0, 1)
qc.swap(0, 2)

print(qc.draw(output="latex_source", with_layout=False))

qc.draw(output="mpl")

from qiskit.quantum_info import Operator

Operator(qc).data

from qiskit import QuantumCircuit, QuantumRegister
from numpy import pi as pi
from qiskit.circuit.library.standard_gates import *

q = QuantumRegister(3, "q")
cx_to_zx90 = QuantumCircuit(3, global_phase=pi / 4)
for inst, qargs, cargs in [
    (RZXGate(pi / 2), [q[0], q[2]], []),
    (SdgGate(), [q[0]], []),
    (SXdgGate(), [q[2]], []),
]:
    cx_to_zx90.append(inst, qargs, cargs)
print(cx_to_zx90.draw(output="latex_source"))
cx_to_zx90.draw(output="mpl")

from qiskit.circuit.library.basis_change import QFT

qc = QFT(4)
qc.decompose().draw(output="mpl")
# print(qc.decompose().draw(output='latex_source'))

import numpy as np

print(np.array(CPhaseGate(pi / 2, 0, 1)))