QVNT
Advansed quantum computation simulator, written in Rust
Features
- Ability to simulate up to 64 qubits, which is a limit for 64-bits machines.
But usual machine (with 4Gb RAM) only allowed to run 26 qubits, which is enough for study cases;
- A set of necessary 1- or 2-qubits operations, including general 1x1 and 2x2 unitary matrix, to build your own quantum circuits;
- Existed quantum operations are tested and debugged to be safe in use;
- Accelerated circuit execution using multithreaded Rayon library;
- Complex quantum registers manipulations: tensor product of two registers and aliases for qubit to humanify interaction with register.
Usage
```rust
use qvnt::prelude::*;
// create quantum register, called 'x', with 10 qubits
let mut qreg = QReg::new(10).aliaschar('x');
// or with initial state, where 3 qubits are already in state |1>
// let qreg = QReg::new(10).aliaschar('x').init_state(0b0011100000);
// get virtual register 'x', to interact with specified qubits
let x = qreg.getvregbychar('x').unwrap();
// create qft operation, acting on first 5 qubits in q_reg
let op = Op::qft(x[0] | x[1] | x[2] | x[3] | x[4]);
// apply operation
q_reg.apply(&op);
// measure and write first 3 qubit, which leads to collapse of qreg wave function
println!("{}", qreg.measure_mask(x[0] | x[1] | x[2]));
```
Implemented operations
- Pauli's X, Y & Z operators;
- S & T operators;
- Phase shift operator;
- 1-qubit rotation operators;
- 2-qubits rotation operators, aka Ising coupling gates;
- SWAP, iSWAP operators and square rooted ones;
- Quantum Fourier Transform;
- Universal U3 operator.
Also, ALL these operators could be turned into controlled ones, using .c(...)
syntax:
rust
let usual_op = Op::x(0b001);
// NOT gate, controlled by 2 qubits, aka CCNOT gate, aka Toffoli gate
let controlled_op = Op::x(0b001).c(0b110);
In work
- Optimizing and vectorizing operations.
- Adding inverse operators for implemented ones.
- Writing documentation for all functions.