Crates.io | th-rust |
lib.rs | th-rust |
version | 0.1.0 |
source | src |
created_at | 2023-04-28 19:10:13.560665 |
updated_at | 2023-04-28 19:10:13.560665 |
description | ThRust is a software framework for thermodynamic and probabilistic computing. |
homepage | http://thrust-lang.org |
repository | https://github.com/chaseklvk/thrust |
max_upload_size | |
id | 851659 |
size | 17,151 |
ThRust is a Rust crate that provides a framework for thermodynamic and probabilistic computing. This package currently supports the following features:
COPY
, NOT
, AND
, OR
.GridPbit
's are used to construct a 2D lattice.
let p0 = GridPbit::new(0, 0);
let p1 = GridPbit::new(0, 1);
This construction can be visualized in the following way:
Pbits can then be used as inputs to probabilistic spin logic (PSL) gates:
let cp0 = Copy::new(p0, p1);
A set of PSL gates can be used to construct a p-circuit:
let circuit = Circuit::new();
circuit.append(Box::new(cp0));
circuit.compile();
Alternatively, circuits can be created from a vector of PSL gates:
let circuit = Circuit::from_vector(vec![Box::new(cp0)]);
circuit.compile();
Finally, create a new simulator to find the ground state configurations via Markov chain Monte Carlo
let mut sim = MCMC::new(circuit);
sim.run();
ThRust also implements basic p-circuit composability. For example, here's an example of a two-gate p-circuit:
let p1 = GridPbit::new(0, 0);
let p2 = GridPbit::new(0, 1);
let p3 = GridPbit::new(1, 0);
let p4 = GridPbit::new(2, 0);
let p5 = GridPbit::new(2, 1);
let mut circuit = Circuit::new();
circuit.append(Box::new(And::new(p1, p2, p3)));
circuit.append(Box::new(Or::new(p3, p4, p5)));
circuit.compile();
let mut sim = MCMC::new(circuit);
sim.run();
Running list of features to implement:
Various references to learn more about probabilistic computing.
If you use this repository, please cite!
See the LICENSE file.