Move StandardGate definition into its own module#15914
Merged
Cryoris merged 1 commit intoQiskit:mainfrom Apr 1, 2026
Merged
Conversation
Collaborator
|
One or more of the following people are relevant to this code:
|
9e30393 to
8acccab
Compare
8acccab to
b00f1f8
Compare
This is a staging commit, splitting up the giant monolithic `qiskit_circuit::operations` to put `StandardGate` in its own module. The code is unchanged, other than imports. This is preparatory for moving more code out of `quantum_info` that connects `StandardGate` to base `quantum-info` objects. Unfortunately I couldn't make this register in `git` as a giant move, so the best way to review this commit is to verify that the diff of the moved block (lines 1163 to 3084) in `crates/circuit/src/operations.rs` in the parent of this commit[^1] is minimal. For example: ```bash ( git show 7ceda63:crates/circuit/src/operations.rs | head -n 3084 | tail -n+1163 ) | diff - crates/circuit/src/standard_gate/mod.rs ``` shows ```text 0a1,27 > // This code is part of Qiskit. > // > // (C) Copyright IBM 2026 > // > // This code is licensed under the Apache License, Version 2.0. You may > // obtain a copy of this license in the LICENSE.txt file in the root directory > // of this source tree or at https://www.apache.org/licenses/LICENSE-2.0. > // > // Any modifications or derivative works of this code must retain this > // copyright notice, and modified files need to carry a notice indicating > // that they have been altered from the originals. > > use crate::circuit_data::{CircuitData, PyCircuitData}; > use crate::operations::{Operation, Param, add_param, clone_param, multiply_param, radd_param}; > use crate::{Qubit, gate_matrix, impl_intopyobject_for_copy_pyclass, imports}; > > use ndarray::{Array2, aview2}; > use num_complex::Complex64; > use smallvec::{SmallVec, smallvec}; > use std::f64::consts::PI; > > use numpy::{IntoPyArray, PyArray2}; > use pyo3::prelude::*; > use pyo3::types::{IntoPyDict, PyList, PyTuple}; > > const FLOAT_ZERO: Param = Param::Float(0.0); > 1920,1922d1946 < < const FLOAT_ZERO: Param = Param::Float(0.0); < ``` [^1]: 7ceda63: Revert "Support commutation check between Pauli-based gates and standard gates (Qiskit#15488)" (Qiskit#15906)
b00f1f8 to
03f1d4e
Compare
Cryoris
approved these changes
Apr 1, 2026
Collaborator
Cryoris
left a comment
There was a problem hiding this comment.
LGTM I verified locally that this the code matches the original with a diff 👍🏻
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a staging commit, splitting up the giant monolithic
qiskit_circuit::operationsto putStandardGatein its own module. The code is unchanged, other than imports.This is preparatory for moving more code out of
quantum_infothat connectsStandardGateto basequantum-infoobjects.Unfortunately I couldn't make this register in
gitas a giant move, so the best way to review this commit is to verify that the diff of the moved block (lines 1163 to 3084) incrates/circuit/src/operations.rsin the parent of this commit1 is minimal. For example:shows
Footnotes
7ceda63: Revert "Support commutation check between Pauli-based gates and standard gates (Support commutation check between Pauli-based gates and standard gates #15488)" (Revert "Support commutation check between Pauli-based gates and standard gates (#15488)" #15906) ↩