Skip to content

Revert "Support commutation check between Pauli-based gates and standard gates (#15488)"#15906

Merged
jakelishman merged 1 commit intoQiskit:mainfrom
Cryoris:revert-pauli-comm
Mar 30, 2026
Merged

Revert "Support commutation check between Pauli-based gates and standard gates (#15488)"#15906
jakelishman merged 1 commit intoQiskit:mainfrom
Cryoris:revert-pauli-comm

Conversation

@Cryoris
Copy link
Copy Markdown
Collaborator

@Cryoris Cryoris commented Mar 30, 2026

Summary

This reverts commit 3942c9c.

#15488 requires some more discussion, including attribution of LLM but also unrelated changes and comments that shouldn't be part of the code base. We've decided to revert this PR for now and re-open it after more discussion and cleanup.

@Cryoris Cryoris requested a review from a team as a code owner March 30, 2026 15:56
@qiskit-bot
Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

Copy link
Copy Markdown
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Julien.

Debasmita, Shelly: just to be clear from #15488 (comment), "LLM use" doesn't block a PR from merging, it just needs to be clearly spelled out in the PR comment / commit message, and ideally marked inline in the code for any bits that were originally LLM generated. There are some other weirdnesses (inline comments like "Wait, Shelly prefers..." probably shouldn't have survived checking / review) and multiple definitions of the same pyfunction in different places, but those are comparatively minor and can be fixed in follow-ups.

The primary reason to revert now is not to rewrite the whole PR, but to make sure that when it goes back in, it's got all the proper LLM attribution in the same git commit and marks out what's LLM generated better - it'll be a lot harder for us to find after the fact if the attributions come in separate places a few commits later.

@jakelishman jakelishman added this pull request to the merge queue Mar 30, 2026
@jakelishman jakelishman added the Changelog: None Do not include in the GitHub Release changelog. label Mar 30, 2026
Merged via the queue into Qiskit:main with commit 7ceda63 Mar 30, 2026
27 checks passed
jakelishman added a commit to jakelishman/qiskit-terra that referenced this pull request Mar 30, 2026
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)
jakelishman added a commit to jakelishman/qiskit-terra that referenced this pull request Mar 31, 2026
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)
github-merge-queue Bot pushed a commit that referenced this pull request Apr 1, 2026
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 (#15488)" (#15906)
@ShellyGarion ShellyGarion added this to the 2.5.0 milestone Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: None Do not include in the GitHub Release changelog.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants