Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Universtal Gate U(theta, phi, lamda) in Open QASM vs Qiskit

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?

like image 530
Robert Singleton Avatar asked Sep 01 '25 17:09

Robert Singleton


1 Answers

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).

like image 98
Ali Javadi Avatar answered Sep 04 '25 07:09

Ali Javadi