Skip to content

Commit

Permalink
Add mc_apply to circuit execution
Browse files Browse the repository at this point in the history
- Multi-controlled gates are now supported by `QuantumCircuit`

- Do not run coverage on patch nor changes
  • Loading branch information
smu160 committed Dec 9, 2023
1 parent 2d0143b commit ee6f986
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ coverage:
status:
project:
default:
target: 85%
target: 85%

patch: no
changes: no
12 changes: 10 additions & 2 deletions spinoza/src/circuit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Abstractions for a quantum circuit
use std::{collections::HashSet, ops::Index};

use crate::gates::mc_apply;
use crate::unitaries::Unitary;
use crate::{
core::State,
Expand Down Expand Up @@ -536,9 +537,16 @@ impl QuantumCircuit {
tr.target,
);
}
_ => {
todo!();
(Controls::Mixed { controls, zeros }, gate) => {
mc_apply(
gate,
&mut self.state,
controls,
Some(zeros.to_owned()),
tr.target,
);
}
_ => todo!(),
}
}
}
Expand Down

0 comments on commit ee6f986

Please sign in to comment.