quantumlib / Stim

A fast stabilizer circuit library.
Apache License 2.0
356 stars 107 forks source link

Type error when generating Tableau from conjugated generators #856

Closed JLenssen closed 1 week ago

JLenssen commented 1 week ago

Hi,

I created a fresh conda environment with Python 3.11.10 on Ubuntu with

conda create -n stim python=3.11 pip
conda activate stim

After installing the following dependencies:

stim~=1.14
numpy~=1.0  # 1.0 instead of 2.0 for pymatching compatibility later
scipy
pymatching

with pip install -r requirements.txt, I ran into the following type error:

import stim

tableau = stim.Tableau.from_conjugated_generators(
  xs=[
    stim.PauliString("+X")
    ],
  xz=[
    stim.PauliString("+Z")
  ]
)

Error message:

TypeError: from_conjugated_generators(): incompatible function arguments. The following argument types are supported:
    1. (*, xs: List[stim._stim_sse2.PauliString], zs: List[stim._stim_sse2.PauliString]) -> stim._stim_sse2.Tableau

Invoked with: kwargs: xs=[stim.PauliString("+X")], xz=[stim.PauliString("+Z")]

Any idea what the issue could be? Missing pybinds?

Versions:

CPU info

Strilanc commented 1 week ago

xz=[ should be xs=[.