Simulating a Quanutum Computer on Raspberry pi Pico
- Raspberry pi pico
- SSD1306 Display module
- Jumper wires
- Bread board
-
Install Thonny python IDE
- For Linux
sudo apt-get install thonny - For Windows/Mac Download setup from --> Here
- For Linux
-
Install micro python on pico
- Refer this Video Here
-
Install libraries for Qpico
- Click on tools -> manage packages
- Search for ssd 1306 library. Download micropython-ssd1306 library.
- A lib folder will be created containing ssd1306.py
- open the simulator.py from the repository in Thonny and press
Ctrl+Shift+son keyboard - click save on raspberry pi pico
- Go in the lib folder
- save in the lib folder as qpico.py
- Run an example sketch form the repo (Before running the code make the circuit given below)
- Circuit connections
- Pin 0 to SDA
- Pin 1 to SCL
- 3.3v to VCC
- GND to GND
-
How to simulate on Qpico
- create a circuit
qc = QuantumCircuit(Number_of_qubits) - Apply Quantum Gates to the Circuit
- Pauli-X Gate :
qc.x(Index_of_Qubit) - Hadamard Gate :
qc.h(Index_of_Qubit) - Pauli-Z :
qc.z(Index_of_Qubit) - Rotation Gate :
qc.r(Angle_in_radians,Index_of_Qubit) - Controll-X Gate :
qc.cx(Controll_Index,Target_Index) - Controll-Z Gate :
qc.cz(Controll_Index,Target_Index) - Controll-R Gate :
qc.cr(Controll_Index,Target_Index) - Controll-Controll-X Gate :
qc.ccx(Controll_Index1,Controll_Index2,Target_Index)
- Pauli-X Gate :
- To measure Qubits :
qc.execute() - Prints a single unitary matrix :
qc.unitary() - Prints the current quantum state of the circuit :
qc.state - Prints the probability of the states :
qc.prob()
- create a circuit
*Currently You can simulate upto 5 Qubits on Qpico.








