Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy issues flagged by latest rust version (backport #13405) #13409

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions crates/accelerate/src/circuit_library/pauli_evolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Instruction> {
Ok((
gate.into(),
params,
Vec::from_iter(qubits.into_iter()),
Vec::new(),
))
Ok((gate.into(), params, Vec::from_iter(qubits), Vec::new()))
},
);

Expand Down Expand Up @@ -294,7 +289,7 @@ pub fn py_pauli_evolution(
/// q_3: ┤ X ├──■───────
/// └─┬─┘
/// q_4: ──■────────────
///
///
fn cx_chain(
active_paulis: Vec<(char, Qubit)>,
) -> Box<dyn DoubleEndedIterator<Item = StandardInstruction>> {
Expand All @@ -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<dyn DoubleEndedIterator<Item = StandardInstruction>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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::<PyTuple>()?.borrow();
let tuple = item.downcast::<PyTuple>()?;

let sparse_pauli: String = tuple.get_item(0)?.downcast::<PyString>()?.extract()?;
let qubits: Vec<u32> = tuple.get_item(1)?.extract()?;
Expand Down