Exam4Training

Which code fragment would yield an operator that represents a single-qubit X gate?

Which code fragment would yield an operator that represents a single-qubit X gate?
A . op = Operator.Xop(0)
B . qc = QuantumCircuit(1)
qc.x(0)
op = Operator(qc)

C . op = Operator([[0,1]])
D . op = Operator([[1,0,0,1]])

Answer: B

Exit mobile version