There might be some Quantum Gates for which only physical implementation is possible by definition is not specified. The Opaque Gates in OpenQASM allow for this functionality. In this chapter of the OpenQASM Tutorial, you will be learning about Opaque Gates in OpenQASM.
Opaque Gates
Opaque Gates are Quantum Gates for which only physical implementation is possible at the level of physical Qubits but whose definition is not specified. Opaque Gates are useful when the system may evolve under some fixed but uncharacterized drift Hamiltonian for some fixed amount of time. The system might be subject to an n-qubit operator whose parameters are computationally challenging to estimate.
Opaque Gates are declared similar to how other user-defined gates are defined, but do not contain a body.
The following is the syntax of creating a Opaque Quantum Gate
opaque gate_name(parameters) quantumarguments;
where name
refers to the name of the Opaque Quantum Gate that we are declaring, parameters
is a comma separated list of variable parameter names, and quantumarguments
is a comma separated list of Qubit arguments.
Note– Notice that for declaring an Opaque Quantum Gate, the keyword gate
gets replaced by the keyword opaque
.
Example
Below is an example of creating a new Opaque Gate gate1
with no parameters and Quantum Argument q1
.
opaque gate1 q1;
Example
Below is an example of creating a new Opaque Gate gate2
with parameters parameter1
, and paramter2
, and Quantum Arguments q1
, and q2
.
opaque gate2(parameter1, parameter2) q1, q2;