qmc/lib.rs
1#![forbid(unsafe_code)]
2#![deny(
3 missing_docs,
4 unreachable_pub,
5 missing_debug_implementations,
6 missing_copy_implementations,
7 trivial_casts,
8 trivial_numeric_casts,
9 unused_import_braces,
10 unused_qualifications
11)]
12
13//! `qmc` is a library for simulating classical and quantum ising systems on a lattice
14//! using monte carlo methods.
15//!
16//! The sse library contains built-in classes to handle ising models, as well as classes which handle
17//! arbitrary interactions.
18//!
19//! It also offers a few feature gated modules:
20//! - parallel tempering system using the `tempering` or `parallel-tempering` feature gates.
21//! - autocorrelation calculations on variables, bonds, or arbitrary values: use `autocorrelations`
22//! - graph serialization using serde with the `serialize` feature.
23//!
24//! # Basic Quantum Ising Example
25//! ```
26//! use qmc::sse::*;
27//! use rand::prelude::*;
28//!
29//! // H = J_ij s_i s_j
30//! let edges = vec![
31//! ((0, 1), -1.0), // ((i, j), J)
32//! ((1, 2), 1.0),
33//! ((2, 3), 1.0),
34//! ((3, 0), 1.0)
35//! ];
36//! let transverse = 1.0;
37//! let longitudinal = 0.0;
38//! let beta = 1.0;
39//!
40//! // Make an ising model using default system prng.
41//! let rng = rand::thread_rng();
42//! let mut g = DefaultQmcIsingGraph::<ThreadRng>::new_with_rng(edges, transverse, longitudinal, 3, rng, None);
43//!
44//! // Take timesteps
45//! g.timesteps(1000, beta);
46//!
47//! // Take timesteps and sample states (as Vec<Vec<bool>>).
48//! let (state, average_energy) = g.timesteps_sample(1000, beta, None);
49//! ```
50
51/// A limited classical monte carlo library for ising models.
52pub mod classical;
53/// QMC algorithms and traits.
54pub mod sse;
55/// Memory management, useful for building custom QMC backends.
56pub mod util;