Skip to content

Commit

Permalink
Merge pull request #19 from notmgsk/hide-wavefunction
Browse files Browse the repository at this point in the history
New: add --hide-wavefunction option
  • Loading branch information
notmgsk authored Jul 30, 2021
2 parents 0fc75dd + 08e71f4 commit 0071270
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ pub enum SimquilError {

#[derive(StructOpt)]
struct Cli {
/// Don't display the wavefunction after simulation
#[structopt(long)]
hide_wavefunction: bool,
quil_file: Option<String>,
}

Expand All @@ -52,9 +55,11 @@ fn run(cli: Cli) -> Result<()> {
let mut vm = VM::new(max_qubits_needed, program);

vm.run().map_err(SimquilError::ExecutionError)?;
println!("Wavefunction amplitudes:");
println!();
println!("{:?}", vm);
if !cli.hide_wavefunction {
println!("Wavefunction amplitudes:");
println!();
println!("{:?}", vm);
}

if !vm.memory.is_empty() {
println!("Classical memory:");
Expand Down

0 comments on commit 0071270

Please sign in to comment.