1
$\begingroup$

How do I implement a 3xControlled U gate with different control states in Qiskit?

The standard circuit.cu() funktion does not implement multiple control qubits in this way but just creates sequential U gates.

I have seen this post on StackExchange but don't really know how to translate it into different control states and would still prefer an implementation without additional helper qubits since I try to rebuild this paper.

the target circuit

$\endgroup$

1 Answer 1

1
$\begingroup$

In qiskit you have the ControlledGate class:

https://qiskit.org/documentation/stubs/qiskit.circuit.ControlledGate.html

In order to have different control states, just prepend an $X$ gate where necessary.

$\endgroup$
1
  • 2
    $\begingroup$ Thanks! With that I found my solution in: c3u_gate = UGate(0.1,0,0).control(3, ctrl_state="100") $\endgroup$ Commented Feb 9, 2023 at 13:55

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.