diff --git a/crates/accelerate/src/circuit_library/pauli_evolution.rs b/crates/accelerate/src/circuit_library/pauli_evolution.rs index be41b51347b..3c5164314c0 100644 --- a/crates/accelerate/src/circuit_library/pauli_evolution.rs +++ b/crates/accelerate/src/circuit_library/pauli_evolution.rs @@ -254,12 +254,7 @@ pub fn py_pauli_evolution( |(((i, pauli), qubits), time)| { let as_packed = pauli_evolution(pauli, qubits, time, false, do_fountain).map( |(gate, params, qubits)| -> PyResult { - Ok(( - gate.into(), - params, - Vec::from_iter(qubits.into_iter()), - Vec::new(), - )) + Ok((gate.into(), params, Vec::from_iter(qubits), Vec::new())) }, ); @@ -294,7 +289,7 @@ pub fn py_pauli_evolution( /// q_3: ┤ X ├──■─────── /// └─┬─┘ /// q_4: ──■──────────── -/// +/// fn cx_chain( active_paulis: Vec<(char, Qubit)>, ) -> Box> { @@ -308,17 +303,17 @@ fn cx_chain( /// Build a CX fountain over the active qubits. E.g. with q_1 inactive, this would return /// -//// ┌───┐┌───┐┌───┐ -//// q_0: ┤ X ├┤ X ├┤ X ├ -//// └─┬─┘└─┬─┘└─┬─┘ -//// q_1: ──┼────┼────┼── -//// │ │ │ -//// q_2: ──■────┼────┼── -//// │ │ -//// q_3: ───────■────┼── -//// │ -//// q_4: ────────────■── -/// +/// ┌───┐┌───┐┌───┐ +/// q_0: ┤ X ├┤ X ├┤ X ├ +/// └─┬─┘└─┬─┘└─┬─┘ +/// q_1: ──┼────┼────┼── +/// │ │ │ +/// q_2: ──■────┼────┼── +/// │ │ +/// q_3: ───────■────┼── +/// │ +/// q_4: ────────────■── +/// fn cx_fountain( active_paulis: Vec<(char, Qubit)>, ) -> Box> { diff --git a/crates/accelerate/src/synthesis/evolution/pauli_network.rs b/crates/accelerate/src/synthesis/evolution/pauli_network.rs index 06290fd1130..b5a73262aae 100644 --- a/crates/accelerate/src/synthesis/evolution/pauli_network.rs +++ b/crates/accelerate/src/synthesis/evolution/pauli_network.rs @@ -15,7 +15,6 @@ use crate::synthesis::clifford::greedy_synthesis::resynthesize_clifford_circuit; use pyo3::prelude::*; use pyo3::types::{PyList, PyString, PyTuple}; use smallvec::{smallvec, SmallVec}; -use std::borrow::Borrow; use qiskit_circuit::circuit_data::CircuitData; use qiskit_circuit::operations::{multiply_param, radd_param, Param, StandardGate}; @@ -334,7 +333,7 @@ pub fn pauli_network_synthesis_inner( // go over the input pauli network and extract a list of pauli rotations and // the corresponding rotation angles for item in pauli_network { - let tuple = item.downcast::()?.borrow(); + let tuple = item.downcast::()?; let sparse_pauli: String = tuple.get_item(0)?.downcast::()?.extract()?; let qubits: Vec = tuple.get_item(1)?.extract()?;