Skip to content

Wrong docstring in CliffordUnitary::from_images #167

Description

The following doc string states that images are provided in groups (first all X, then all Z):

@staticmethod
def from_images(images: Sequence[DensePauli]) -> "CliffordUnitary":
"""Create from images of the X and Z generators.
Args:
images: Sequence of Pauli operators [X_0, ..., X_{n-1}, Z_0, ..., Z_{n-1}].
"""

However, the underlying Rust implementation expects them in interleaved order:

for qubit_index in 0..(preimages.len() / 2) {
let x_preimage = preimages.next().expect("there should be `preimages.len()` items");
let z_preimage = preimages.next().expect("there should be `preimages.len()` items");
res.preimage_x_view_mut(qubit_index).assign(x_preimage);
res.preimage_z_view_mut(qubit_index).assign(z_preimage);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions