Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ismaelfaro/v_lang-quantum-simulator
Simple Quantum Simulator implemented in V Lang
https://github.com/ismaelfaro/v_lang-quantum-simulator
Last synced: 15 days ago
JSON representation
Simple Quantum Simulator implemented in V Lang
- Host: GitHub
- URL: https://github.com/ismaelfaro/v_lang-quantum-simulator
- Owner: ismaelfaro
- License: apache-2.0
- Created: 2023-12-24T04:16:29.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-01-02T14:46:40.000Z (10 months ago)
- Last Synced: 2024-01-02T15:54:37.392Z (10 months ago)
- Language: V
- Size: 261 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# V lang Quantum Simulator
This is a very basic implementation of a Quantum Simulator in Vlang to learn the basic concepts.
You can understand how work a quamtum computer from the code. The code is devide in two parts, one part allow you create Quantum circuits with basic Quantum Gates, and you can execute it using plain vlang# Components
- structs
- Gates: x, rx, ry, rz, z, y, h, cx, m
- Quantum Circuit- Quantum Simulator:
- imput: Quantum Circuit
- outputs:
- statevector# Install
Visit https://vlang.io and install the language
```
git clone https://github.com/ismaelfaro/V_lang-quantum-simulator.gitcd V_lang-quantum-simulator
```# Run
```
v run .
```# Example:
```
qubits := i32(10)mut qc := QuantumCircuit{qubits: qubits}
qc.h(0)
qc.h(1)
qc.h(2)
qc.h(3)
qc.h(4)qc.cx(0,5)
qc.cx(1,6)
qc.cx(2,7)
qc.cx(3,8)
qc.cx(4,9)println(qc)
mut qsim := QuantumSimulator{qubits: qubits, circuit: qc}
qsim.init()
qsim.run(1024)print(qsim)
```
# TODO:
- refactor the code to be more Vlang friendly
- fix the outputs for
- counts
- memory# references
Inspired in MicroQiskit python implementation https://github.com/qiskit-community/MicroQiskit by James Wootton