1

I have noticed that Open QASM and Qiskit define the universal single-qubit gate U(lambda, theta, phi) differently. The difference causes a phase difference in RZ, for example.

Has anyone come across this problem? Which should one choose?

fatihyildizhan
  • 7,103
  • 5
  • 54
  • 74

1 Answers1

1

The gate U in OpenQASM 2 was defined as a special unitary (i.e. determinant=1). But if you are writing circuits in the OpenQASM 2 language, this choice should not be consequential, as OpenQASM 2 does not have a way of explicitly dealing with global phases (and they are not observable).

OpenQASM 3 on the other hand has a mechanism for controlling gates. This makes global phases consequential (controlling turns the global phase into a relative, observable phase). It turns out the new definition of U in OpenQASM 3 is the same as the definition in Qiskit. If you are writing circuits in OpenQASM 3 or Qiskit, then global phases matter. Therefore you should use this new definition.

(As a side note, the new definition is chosen because standard gates such as Paulis can be derived from it in a more straightforward way).

Ali Javadi
  • 121
  • 2