Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
chemix-lunacy committed Aug 20, 2024
1 parent d79499a commit 9599c6a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
7 changes: 6 additions & 1 deletion src/rasqal/src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,13 @@ impl StateFragment {
return Some(String::from("Can't expand fragment to size of the state."));
}

let before = self.to_string();
let multiplying_woth = gate.matrix.to_string();
self.matrix.mul_assign(&gate.matrix);
None
let after = self.to_string();
let whatever = "WHAT";
let something = None;
something
}
}

Expand Down
15 changes: 13 additions & 2 deletions src/rasqal/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,23 @@ impl RasqalConfig {

pub fn trace_graphs(&mut self) { self.debug_tracers.insert(ActiveTracers::Graphs); }

pub fn trace_solver(mut self) -> RasqalConfig {
pub fn with_trace_runtime(mut self) -> RasqalConfig { self.debug_tracers.insert(ActiveTracers::Runtime); self }

pub fn with_trace_projections(mut self) -> RasqalConfig { self.debug_tracers.insert(ActiveTracers::Projections); self }

pub fn with_trace_graphs(mut self) -> RasqalConfig { self.debug_tracers.insert(ActiveTracers::Graphs); self }

pub fn with_step_count_limit(mut self, count: i64) -> RasqalConfig {
self.step_count_limit = Some(count);
self
}

pub fn with_trace_solver(mut self) -> RasqalConfig {
self.debug_tracers.insert(ActiveTracers::Solver);
self
}

pub fn activate_solver(mut self) -> RasqalConfig {
pub fn with_activate_solver(mut self) -> RasqalConfig {
self.solver_active = true;
self
}
Expand Down
13 changes: 8 additions & 5 deletions src/rasqal/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,7 @@ mod tests {
fn fail(path: &str) -> Option<String> { fail_with_config(path, RasqalConfig::default()) }

fn fail_with_args(path: &str, args: &Vec<Value>) -> Option<String> {
run_with_args_and_config(
path, args, RasqalConfig::default()
).err()
run_with_args_and_config(path, args, RasqalConfig::default()).err()
}

fn fail_with_config(path: &str, config: RasqalConfig) -> Option<String> {
Expand All @@ -245,7 +243,8 @@ mod tests {

#[test]
fn execute_qaoa() {
run("../tests/qsharp/qaoa/qir/qaoa.ll");
let config = RasqalConfig::default().with_activate_solver().with_trace_solver();
run_with_config("../tests/qsharp/qaoa/qir/qaoa.ll", config);
}

#[test]
Expand All @@ -255,7 +254,11 @@ mod tests {

#[test]
fn execute_oracle_generator() {
run("../tests/qsharp/oracle-generator/qir/oracle-generator.ll");
let config = RasqalConfig::default().with_activate_solver().with_trace_solver();
run_with_config(
"../tests/qsharp/oracle-generator/qir/oracle-generator.ll",
config
);
}

#[test]
Expand Down

0 comments on commit 9599c6a

Please sign in to comment.