Crates.io | qvnt-i |
lib.rs | qvnt-i |
version | 0.4.4 |
source | src |
created_at | 2022-08-02 19:39:54.397539 |
updated_at | 2023-03-10 13:32:55.735524 |
description | Advanced quantum computation simulator. |
homepage | |
repository | https://github.com/MucTepDayH16/qvnt-i/ |
max_upload_size | |
id | 637535 |
size | 119,907 |
It is REPL interpreter, that could be used to process quantum operation without compiling code.
cargo install qvnt-i
Now, you are able to 'run' quantum simulator with OpenQASM language.
*.qasm
files should be passed to interpreter via cli:
qvnt-i ./cirquit.qasm
|Q> :go
or via interpreter:
qvnt-i
|Q> :load ./cirquit.qasm
|Q> :go
Another way of running simulator is writing cirquit on OpenQASM language directly in REPL:
qvnt-i
|Q> qreg q[4];
|Q> creg c[4];
|Q> h q;
|Q> measure q -> c;
|Q> :go
|Q> :class
:go
- process the simulation;:class
- acquire the result from classical register.REPL is lazy: it only starts computation, if it encounters :go
.
This example will shows the single number every time:
|Q> qreg q[4];
|Q> creg c[4];
|Q> h q;
|Q> measure q -> c;
|Q> :go
|Q> :class
|Q> :class
|Q> :class
|Q> :class
...
Unlike that, repeating :go
will proceed with different result every time:
|Q> qreg q[4];
|Q> creg c[4];
|Q> h q;
|Q> measure q -> c;
|Q> :go
|Q> :class
|Q> :go
|Q> :class
|Q> :go
|Q> :class
...
All commands should be preceeded with :
.
Otherwise, REPL considers to parse line as OpenQASM source.
The full list of commands:
loop N Repeat following commands N time
tags TAG Create TAG with current state
goto TAG Swap current state to TAG's state
class Show state of classical registers
polar Show state of quantum registers in polar form
prob Show state of quantum registers in probability form
ops Snow current quantum operations queue
go Start modulating quantum computer
reset Clear current state
names Show aliases for quantum and classical bits
load FILE Load state from FILE according to QASM language script
help Show this reference
quit Exit interpreter
Licensed under MIT License