0

I am qurious about the order of ctrl_state

The Quantum Circuit what I expected is this.

enter image description here

q1 is controled when '0' and q2 and a3 is controled when '1'

So I wirte code that is

ctrl_state='011'

But what I got is this. Why I got oposite form like this... What is the principle of this.

enter image description here

from qiskit import*
from qiskit.extensions import UnitaryGate
matrix_V2_2=[[1,0],[0,1]]
Won_gate = UnitaryGate(matrix_V2_2,label='Won').control(num_ctrl_qubits=3, ctrl_state='011')
main_circuit=QuantumCircuit(4,4)
main_circuit.append(Won_gate ,[1,2,3,0])
%matplotlib inline
main_circuit.draw(output='mpl')
윤성원
  • 21
  • 2

1 Answers1

1

This is because Qiskit uses little-endian bit ordering. That means, in your case ctrl_state should be $q_3 q_2 q_1$.

You can find more details here and here.

Egretta.Thula
  • 9,972
  • 1
  • 11
  • 30