Building Circuits in QuTiP

22 views
Skip to first unread message

Karthik Venkatesh Nagaraj

unread,
Jan 25, 2025, 2:29:58 PMJan 25
to QuTiP: Quantum Toolbox in Python
Hello everyone, 
I am trying to replicate this Qiskit circuit in QuTiP, for which I have a few questions. 
def _werner_circuit():
    q = QuantumRegister(2, name='q')
    c = ClassicalRegister(1, name='c')
    o = ClassicalRegister(2, name='o')
    C = QuantumCircuit(q, c, o, name='werner')

    C.ry(Parameter('θ'), 0)
    C.measure(0, c)
    C.x(1).c_if(c, 1)
    C.h(0)
    C.h(1).c_if(c, 0)
    C.cx(0, 1).c_if(c, 1)
    C.measure(q, o).c_if(c, 0)

    return C


1) Is there a way to use dynamic parameters like the "theta" variable used in the RY gate below, but in QuTiP? I would like to run the circuit with different values of theta during circuit simulation. 

2) What is the equivalent implementation of the "c_if" functionality in QuTiP? 

3) Finally, not relevant to the above circuit, but how do I go about implementing a Controlled Hadamard gate in QuTiP? 

Thanks!
Reply all
Reply to author
Forward
0 new messages