ProductPromotion
Logo

Rust

made by https://0x3d.site

GitHub - beneills/quantum: Advanced Rust quantum computer simulator
Advanced Rust quantum computer simulator. Contribute to beneills/quantum development by creating an account on GitHub.
Visit Site

GitHub - beneills/quantum: Advanced Rust quantum computer simulator

GitHub - beneills/quantum: Advanced Rust quantum computer simulator

quantum Build Status License

Advanced Rust quantum computer simulator.

Motivation

Quantum is a quantum computer simulator written with the following design goals in mind:

  1. Utility: we can simulate a 5-qubit register, enough to run interesting algorithms.

  2. Efficiency: we implement all important operations from scratch using primitives

  3. Educational Value: the documentation is a prose description of how to implement a quantum computer in Rust.

  4. Correctness: it's entirely written in safe Rust with well-defined states.

A good place to start reading the theory behind this is the Wikipedia article, and you can follow the documentation for our implementations of gates, kets, common operations, and quantum registers.

Usage

# Cargo.toml

[dependencies]
quantum = "0.1.3"
// main.rs

use computer::QuantumComputer;
use algorithms::deutsch;
use gates;

// Let's do something simple of a 3-qubit system.
let mut c1 = QuantumComputer::new(3);
c1.initialize(5);
c1.apply(gates::identity(3));
c1.collapse();
assert_eq!(5, c1.value());

// Now let's perform a coin flip using the Hadamard transform.
let mut c2 = QuantumComputer::new(1);
c2.initialize(0);
c2.apply(gates::hadamard(1));
c2.collapse();
let result = if 1 == c2.value() { "heads" } else { "tails" };
println!("coin flip: {}", result);

// Finally let's determine whether f: {0, 1} -> {0, 1} is constant
// or balanced using Deutsch's algorithm.
// (see http://physics.stackexchange.com/q/3400)
let mut c3 = QuantumComputer::new(2);
c3.initialize(1);
c3.apply(gates::hadamard(2));
c3.apply(deutsch::deutsch_gate(f));
c3.apply(gates::hadamard(2));
c3.collapse();
let result = if 1 == c3.value() { "constant" } else { "balanced" };
println!("f is: {}", result);

Gates

We provide the following quantum gates:

  • Identity
  • Hadamard
  • Pauli-X
  • Pauli-Y
  • Pauli-Z
  • Phase Shifts
  • Swap
  • Sqrt(Swap)
  • Controlled Not
  • General Controlled-U
  • Controlled-X
  • Controlled-Y
  • Controlled-Z
  • Toffoli
  • Fredkin
  • Quantum Fourier Transform

Contributing

  • Create or take ownership of an issue
  • Fork development branch
  • Write code and tests
  • rust test
  • Commit with a reasonable message and push
  • Submit a pull request

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory