Skip to content

Commit 7528db9

Browse files
committed
Inital attempt at oxidizing unitary synthesis.
1 parent 2fa6dd6 commit 7528db9

File tree

10 files changed

+1302
-31
lines changed

10 files changed

+1302
-31
lines changed

crates/accelerate/src/euler_one_qubit_decomposer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ pub fn generate_circuit(
579579

580580
const EULER_BASIS_SIZE: usize = 12;
581581

582-
static EULER_BASES: [&[&str]; EULER_BASIS_SIZE] = [
582+
pub static EULER_BASES: [&[&str]; EULER_BASIS_SIZE] = [
583583
&["u3"],
584584
&["u3", "u2", "u1"],
585585
&["u"],
@@ -593,7 +593,7 @@ static EULER_BASES: [&[&str]; EULER_BASIS_SIZE] = [
593593
&["rz", "sx", "x"],
594594
&["rz", "sx"],
595595
];
596-
static EULER_BASIS_NAMES: [EulerBasis; EULER_BASIS_SIZE] = [
596+
pub static EULER_BASIS_NAMES: [EulerBasis; EULER_BASIS_SIZE] = [
597597
EulerBasis::U3,
598598
EulerBasis::U321,
599599
EulerBasis::U,

crates/accelerate/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub mod synthesis;
4343
pub mod target_transpiler;
4444
pub mod two_qubit_decompose;
4545
pub mod uc_gate;
46+
pub mod unitary_synthesis;
4647
pub mod utils;
4748
pub mod vf2_layout;
4849

crates/accelerate/src/target_transpiler/nullable_index_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ where
4242
K: Eq + Hash + Clone,
4343
V: Clone,
4444
{
45-
map: BaseMap<K, V>,
45+
pub map: BaseMap<K, V>,
4646
null_val: Option<V>,
4747
}
4848

crates/accelerate/src/two_qubit_decompose.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,11 @@ impl Specialization {
404404
#[pyclass(module = "qiskit._accelerate.two_qubit_decompose", subclass)]
405405
pub struct TwoQubitWeylDecomposition {
406406
#[pyo3(get)]
407-
a: f64,
407+
pub a: f64,
408408
#[pyo3(get)]
409-
b: f64,
409+
pub b: f64,
410410
#[pyo3(get)]
411-
c: f64,
411+
pub c: f64,
412412
#[pyo3(get)]
413413
pub global_phase: f64,
414414
K1l: Array2<Complex64>,
@@ -1146,17 +1146,18 @@ impl TwoQubitWeylDecomposition {
11461146

11471147
type TwoQubitSequenceVec = Vec<(Option<StandardGate>, SmallVec<[f64; 3]>, SmallVec<[u8; 2]>)>;
11481148

1149+
#[derive(Clone, Debug)]
11491150
#[pyclass(sequence)]
11501151
pub struct TwoQubitGateSequence {
1151-
gates: TwoQubitSequenceVec,
1152+
pub gates: TwoQubitSequenceVec,
11521153
#[pyo3(get)]
1153-
global_phase: f64,
1154+
pub global_phase: f64,
11541155
}
11551156

11561157
#[pymethods]
11571158
impl TwoQubitGateSequence {
11581159
#[new]
1159-
fn new() -> Self {
1160+
pub fn new() -> Self {
11601161
TwoQubitGateSequence {
11611162
gates: Vec::new(),
11621163
global_phase: 0.,
@@ -1188,10 +1189,12 @@ impl TwoQubitGateSequence {
11881189
}
11891190
}
11901191
}
1192+
1193+
#[derive(Clone, Debug)]
11911194
#[allow(non_snake_case)]
11921195
#[pyclass(module = "qiskit._accelerate.two_qubit_decompose", subclass)]
11931196
pub struct TwoQubitBasisDecomposer {
1194-
gate: String,
1197+
pub gate: String,
11951198
basis_fidelity: f64,
11961199
euler_basis: EulerBasis,
11971200
pulse_optimize: Option<bool>,
@@ -1575,7 +1578,7 @@ impl TwoQubitBasisDecomposer {
15751578
Ok(res)
15761579
}
15771580

1578-
fn new_inner(
1581+
pub fn new_inner(
15791582
gate: String,
15801583
gate_matrix: ArrayView2<Complex64>,
15811584
basis_fidelity: f64,
@@ -1713,7 +1716,7 @@ impl TwoQubitBasisDecomposer {
17131716
})
17141717
}
17151718

1716-
fn call_inner(
1719+
pub fn call_inner(
17171720
&self,
17181721
unitary: ArrayView2<Complex64>,
17191722
basis_fidelity: Option<f64>,

0 commit comments

Comments
 (0)