-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New 3-qubit and 4-qubit Gates (#592)
* temp commit * moved to new file * first tests * mqg test fixes * prelude OperateFourQubit * four_qubit_gate_op file mod * tests mod * involv qubits * lib OperateFourQubit * substitute control_2 * finished testing cccx * circuits * again circuits * tests * operate enum four + three fix * missed build.rs stuff (enum) * OperateFourQubitGate * JsonSchema test * doctests fix * newline * feature gate * missed qoqo build.rs * mod qoqo * lib qoqo-macro * interface * interface tests * fmt * CHANGELOG * json_schema fix * compat tests * lock * qoqo * macros * derive * test * roqoqo * changelog * build.rs roq * ops mod roq * copyright * lock * DEP * fixed changelog * again fix * cswap definitions * cswap tests * qoqo-macros new targets-controls * prelude * OperateThreeQubit new sol * involvequbits new targets-controls * again * operate n qubits new targets-controls * substitute * test fix * lock * doc fix * changelog * triplecontrolledphaseshift definitions * changelog * triplecontrolledphaseshift tests * phase-shifted changelog * roq derive sol (to be changed) * phase-shifted double-controlled definitions * phse-shifted double-controlled tests * roq derive incompatibility fix (wip qoqo) * better docs * qoqo compatiiblity issue cswap fix * fmt * qoqo mod * redundant changlog * clippy * dereference * pr corrections * misisng tests * small derive fixes * no target_0 target_1 reserved fields
- Loading branch information
Showing
25 changed files
with
4,120 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// Copyright © 2021-2024 HQS Quantum Simulations GmbH. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
// in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software distributed under the | ||
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use num_complex::Complex64; | ||
use numpy::{PyArray2, ToPyArray}; | ||
|
||
use qoqo_calculator::CalculatorFloat; | ||
use qoqo_calculator_pyo3::{convert_into_calculator_float, CalculatorFloatWrapper}; | ||
|
||
use crate::CircuitWrapper; | ||
|
||
use pyo3::exceptions::{PyRuntimeError, PyValueError}; | ||
use pyo3::prelude::*; | ||
use pyo3::types::PySet; | ||
|
||
use std::collections::HashMap; | ||
|
||
#[cfg(feature = "json_schema")] | ||
use roqoqo::ROQOQO_VERSION; | ||
|
||
use roqoqo::operations::*; | ||
|
||
use qoqo_macros::*; | ||
|
||
#[wrap( | ||
Operate, | ||
OperateFourQubit, | ||
OperateGate, | ||
OperateFourQubitGate, | ||
JsonSchema | ||
)] | ||
/// The triple-controlled PauliX gate. | ||
/// | ||
pub struct TripleControlledPauliX { | ||
control_0: usize, | ||
control_1: usize, | ||
control_2: usize, | ||
target: usize, | ||
} | ||
|
||
#[wrap( | ||
Operate, | ||
OperateFourQubit, | ||
OperateGate, | ||
OperateFourQubitGate, | ||
JsonSchema | ||
)] | ||
/// The triple-controlled PauliZ gate. | ||
/// | ||
pub struct TripleControlledPauliZ { | ||
control_0: usize, | ||
control_1: usize, | ||
control_2: usize, | ||
target: usize, | ||
} | ||
|
||
#[wrap( | ||
Operate, | ||
OperateFourQubit, | ||
OperateGate, | ||
OperateFourQubitGate, | ||
JsonSchema | ||
)] | ||
/// The triple-controlled PhaseShift gate. | ||
/// | ||
pub struct TripleControlledPhaseShift { | ||
control_0: usize, | ||
control_1: usize, | ||
control_2: usize, | ||
target: usize, | ||
theta: CalculatorFloat, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.