Skip to content

Commit

Permalink
removing the charge state caching as it is slower than recomputing
Browse files Browse the repository at this point in the history
  • Loading branch information
b-vanstraaten committed Sep 18, 2024
1 parent 5489a84 commit 18ab928
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "qarray_rust_core"
version = "1.3.0"
version = "1.3.1"
edition = "2021"

[lib]
Expand Down
5 changes: 2 additions & 3 deletions src/charge_configurations.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use cached::proc_macro::cached;
use ndarray::{s, Array, Array1, Array2, Axis, Ix2};

pub fn open_charge_configurations(n_continuous: Array1<f64>, threshold: f64) -> Array<f64, Ix2> {
Expand Down Expand Up @@ -106,7 +105,7 @@ pub fn closed_charge_configurations(
return charge_configurations.mapv(|x| x as f64);
}

#[cached(size = 1024)]
// #[cached(size = 16)]
fn _open_charge_configurations(floor_values: Array1<u64>) -> Array2<u64> {
let n_dot = floor_values.len() as u64;
let num_combinations = 1u64 << n_dot;
Expand All @@ -124,7 +123,7 @@ fn _open_charge_configurations(floor_values: Array1<u64>) -> Array2<u64> {
Array2::from_shape_vec((rows, n_dot as usize), result).expect("Failed to reshape array")
}

#[cached(size = 1024)]
// #[cached(size = 16)]
fn _closed_charge_configurations(floor_values: Array1<u64>, n_charge: u64) -> Array2<u64> {
let n_dot = floor_values.len() as u64;
let floor_sum: u64 = floor_values.sum();
Expand Down

0 comments on commit 18ab928

Please sign in to comment.