1OPENQASM 2.0; // Open Quantum Assembly Language to write basic quantum circiutis
2 // QASM documentation and examples https://arxiv.org/abs/1707.03429
3include "qelib1.inc"; // standard header with basic library
4
5
6qreg qubit[1]; // Create a register of just one qubit called qubit
7creg classicalbit[1]; // Create a register of just one bit called classicalbit
8
9
10 z qubit[0]; // pi rotation about the Z-axis
11// x qubit[0]; // pi rotation about the X-axis
12// y qubit[0]; // pi rotation about the Y-axis
13// h qubit[0]; // The combination of two rotations, pi about the Z-axis followed by pi/2 about the Y-axis
14
15// s qubit[0]; // S-gate, square root of Z gate
16// sdg qubit[0]; // conjugate of S-gate
17// t qubit[0]; // Phase-gate, conjugate of square root of S-gate
18// tdg qubit[0]; // conjugate of Phase-gate
19
20// rx(0) // rotation around X-axis
21// ry(0) // rotation around Y-axis
22// rz(0) // rotation around Z axis
23
24//ry(-pi/7) qubit[0];
25
26
27barrier qubit[0];
28measure qubit[0] -> classicalbit[0];
29