This project is a Quantum Computer Simulator that uses Python to mimic results of a physical Quantum Computer. The program takes in a QASM file, returns the final state vector, and plots measurement results.
- I - Identity (I)
- X - Pauli-X (X)
- Y - Pauli-Y (Y)
- Z - Pauli-Z (Y)
- H - Hadamard (H)
- S - Phase (S, P)
- S† - Conjugate Transpose of S
- T - π/8 (T)
- T† - Conjugate Transpose of T
- CX - Controlled Not (CNOT, CX)
- U - Custom Unitary
This program reads in a QASM file to create the initial state and apply the relevant gates. QASM (Quantum Assembly Language) is a low-level language used to program Quantum Computers. IBM Quantum Composer allows you to visually create a circuit using logic blocks that can be exported as a QASM file. Simply paste the file path into the program and run the main cell to recieve the results of the experiment.
Note
- The first 2 lines of IBM's QASM file contain the version and a library inculsion. These are followed by a blank space. For simplicity, leave these in the file and don't include any other spaces in the QASM file.
- The Unitary gate by default has π/2 for the Theta, Phi, and Lambda parameters. For this program, make sure the parameters are decimal or float numbers
This program uses Kronecker products to create a quantum state and apply gate transformations to it. This was done to accommodate for the CNOT gate which entangles 2 Qubits, and therefore makes it impossible to represent them as seperable qubit vectors.
The simulator also simulates noise that is seen in real-world experiments. Change the value of the noise parameter from the default 0.01 to experience higher or lower noise in the data's results. Noise is experienced in the measuring portion of the program and it is done to mimic the dark counts experienced by physical qubit measurement apparatus.
The simulator already applies a computational basis measurement to each qubit at the end. Therefore, it is not needed to add measurement gates in the Quantum Composer circuit or QASM file.
This project was the final project for the Quantum Computing I stream of the UT Austin Freshman Research Initiative. Below is a link to a presentation that includes an overview of the project, experimental results, and a comparison to IBM's simulator results. https://docs.google.com/presentation/d/1PQq5UbhUgi7Pp6gAufiHn1PWFwyILQEj3BDO-2yfxKE/edit?usp=sharing