Skip to content

Commit

Permalink
missed from last PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mlodi-hqs committed Oct 17, 2024
1 parent 2aef56c commit aea4f5d
Show file tree
Hide file tree
Showing 6 changed files with 371 additions and 380 deletions.
8 changes: 3 additions & 5 deletions qoqo/src/operations/three_qubit_gate_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ impl ControlledSWAPWrapper {
})?,
})
}
/// Remap qubits
/// Remap qubits in the ControlledSWAP operation
///
/// Args:
/// mapping (Dict[int, int]): The mapping
/// mapping (Dict[int, int]): The mapping to be used in the remapping.
///
/// Returns:
/// Operation: The operation with the remapped qubits
Expand All @@ -238,7 +238,7 @@ impl ControlledSWAPWrapper {
internal: new_internal,
})
}
/// List all involved Qubits
/// List all involved qubits in the ControlledSWAP operation.
///
/// Returns:
/// Union[Set[int], str]: The involved qubits as a set or 'ALL' if all qubits are involved
Expand Down Expand Up @@ -302,7 +302,6 @@ impl ControlledSWAPWrapper {
)]
/// The phased-shifted double-controlled-Z gate.
///
///
/// The unitary matrix representation is:
///
/// .. math::
Expand Down Expand Up @@ -341,7 +340,6 @@ pub struct PhaseShiftedControlledControlledZ {
)]
/// The phased-shifted double-controlled-Z gate.
///
///
/// The unitary matrix representation is:
///
/// .. math::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,18 @@
use ndarray::Array2;
use num_complex::Complex64;
use numpy::PyArray2;

use qoqo_calculator::CalculatorFloat;

use pyo3::prelude::*;
use std::collections::HashMap;

use qoqo::operations::{
convert_operation_to_pyobject, TripleControlledPauliXWrapper, TripleControlledPauliZWrapper,
TripleControlledPhaseShiftWrapper,
};
use qoqo::CircuitWrapper;
use qoqo_calculator::CalculatorFloat;
use roqoqo::operations::*;
#[cfg(feature = "json_schema")]
use roqoqo::ROQOQO_VERSION;
use roqoqo::{Circuit, RoqoqoError};

use std::collections::HashMap;
use test_case::test_case;

#[test_case(Operation::from(TripleControlledPauliX::new(0, 1, 2, 3)); "TripleControlledPauliX")]
Expand Down
8 changes: 4 additions & 4 deletions roqoqo-derive/src/operate_n_qubit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,19 +435,19 @@ fn operate_four_qubit_struct(ident: Ident) -> TokenStream {
/// Trait for Operations acting on exactly four qubits.
impl OperateFourQubit for #ident{
/// Returns `control_0` qubit of the four qubit Operation.
fn control_0(&self ) -> &usize {
fn control_0(&self) -> &usize {
&self.control_0
}
/// Returns `control_1` qubit of the four qubit Operation.
fn control_1(&self ) -> &usize {
fn control_1(&self) -> &usize {
&self.control_1
}
/// Returns `control_2` qubit of the four qubit Operation.
fn control_2(&self ) -> &usize {
fn control_2(&self) -> &usize {
&self.control_2
}
/// Returns `target` qubit of the four qubit Operation.
fn target(&self ) -> &usize {
fn target(&self) -> &usize {
&self.target
}
}
Expand Down
2 changes: 1 addition & 1 deletion roqoqo-derive/src/operate_unitary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ fn four_qubit_gate_struct(ident: Ident) -> TokenStream {
quote! {
#[automatically_derived]
impl OperateFourQubitGate for #ident{
fn circuit(&self ) -> crate::Circuit {
fn circuit(&self) -> crate::Circuit {
self.circuit
}
}
Expand Down
3 changes: 0 additions & 3 deletions roqoqo/src/operations/four_qubit_gate_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use num_complex::Complex64;

/// The triple-controlled PauliX gate.
///
///
#[allow(clippy::upper_case_acronyms)]
#[derive(
Debug,
Expand Down Expand Up @@ -92,7 +91,6 @@ impl OperateFourQubitGate for TripleControlledPauliX {

/// The triple-controlled PauliZ gate.
///
///
#[allow(clippy::upper_case_acronyms)]
#[derive(
Debug,
Expand Down Expand Up @@ -166,7 +164,6 @@ impl OperateFourQubitGate for TripleControlledPauliZ {

/// The triple-controlled PhaseShift gate.
///
///
#[allow(clippy::upper_case_acronyms)]
#[derive(
Debug,
Expand Down
Loading

0 comments on commit aea4f5d

Please sign in to comment.