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); |
|
} |
The following doc string states that
imagesare provided in groups (first all X, then all Z):qdk-ec/paulimer/bindings/python/paulimer.pyi
Lines 513 to 519 in 96dc7de
However, the underlying Rust implementation expects them in interleaved order:
qdk-ec/paulimer/src/clifford/generic_algos.rs
Lines 345 to 350 in 96dc7de