Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 196 additions & 0 deletions crates/ppvm-python-native/ppvm_python_native.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
from typing import Sequence


class _PauliSumBase:
Comment on lines +1 to +4
def __init__(
self,
n_qubits: int,
min_abs_coeff: float = 1e-10,
max_pauli_weight: int = ...,
max_loss_weight: int = ...,
terms: list[str] = ...,
coefficients: list[float] = ...,
) -> None: ...
Comment on lines +5 to +13
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __copy__(self) -> "_PauliSumBase": ...
def __deepcopy__(self, memo: object) -> "_PauliSumBase": ...
def __len__(self) -> int: ...
def trace(self, pattern: str) -> float: ...
def overlap_with_zero(self) -> float: ...
def overlap(self, other: "_PauliSumBase") -> float: ...
def x(self, addr0: int) -> None: ...
def y(self, addr0: int) -> None: ...
def z(self, addr0: int) -> None: ...
def h(self, addr0: int) -> None: ...
def s(self, addr0: int) -> None: ...
def cnot(self, addr0: int, addr1: int) -> None: ...
def cz(self, addr0: int, addr1: int) -> None: ...
def s_adj(self, addr0: int) -> None: ...
Comment on lines +22 to +29
def sqrt_x(self, addr0: int) -> None: ...
def sqrt_y(self, addr0: int) -> None: ...
def sqrt_x_adj(self, addr0: int) -> None: ...
def sqrt_y_adj(self, addr0: int) -> None: ...
def rx(self, addr0: int, theta: float) -> None: ...
def ry(self, addr0: int, theta: float) -> None: ...
def rz(self, addr0: int, theta: float) -> None: ...
def r(self, addr0: int, axis_angle: float, theta: float) -> None: ...
def rxx(self, addr0: int, addr1: int, theta: float) -> None: ...
def ryy(self, addr0: int, addr1: int, theta: float) -> None: ...
def rzz(self, addr0: int, addr1: int, theta: float) -> None: ...
def pauli_error(self, addr0: int, p: Sequence[float]) -> None: ...
def two_qubit_pauli_error(
self, addr0: int, addr1: int, p: Sequence[float]
) -> None: ...
def depolarize(self, addr0: int, p: float) -> None: ...
def depolarize2(self, addr0: int, addr1: int, p: float) -> None: ...
def amplitude_damping(self, addr0: int, gamma: float) -> None: ...
def terms(self) -> list[tuple[str, float]]: ...
def weights(self) -> list[tuple[str, int]]: ...
def current_max_weight(self) -> int: ...


class _PauliSumLossBase(_PauliSumBase):
def loss_channel(self, addr0: int, p: float) -> None: ...
def correlated_loss_channel(
self, addr0: int, addr1: int, p: Sequence[float]
) -> None: ...
def reset_loss_channel(self, addr0: int) -> None: ...


class PauliSumIndexMapFxHash0(_PauliSumBase): ...
class PauliSumIndexMapFxHash1(_PauliSumBase): ...
class PauliSumIndexMapFxHash2(_PauliSumBase): ...
class PauliSumIndexMapFxHash3(_PauliSumBase): ...
class PauliSumIndexMapFxHash4(_PauliSumBase): ...
class PauliSumIndexMapFxHash5(_PauliSumBase): ...
class PauliSumIndexMapFxHash6(_PauliSumBase): ...
class PauliSumIndexMapFxHash7(_PauliSumBase): ...
class PauliSumIndexMapFxHash8(_PauliSumBase): ...
class PauliSumIndexMapFxHash9(_PauliSumBase): ...
class PauliSumIndexMapFxHash10(_PauliSumBase): ...
class PauliSumIndexMapFxHash11(_PauliSumBase): ...
class PauliSumIndexMapFxHash12(_PauliSumBase): ...
class PauliSumIndexMapFxHash13(_PauliSumBase): ...
class PauliSumIndexMapFxHash14(_PauliSumBase): ...
class PauliSumIndexMapFxHash15(_PauliSumBase): ...

class PauliSumLossIndexMapFxHash0(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash1(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash2(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash3(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash4(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash5(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash6(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash7(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash8(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash9(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash10(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash11(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash12(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash13(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash14(_PauliSumLossBase): ...
class PauliSumLossIndexMapFxHash15(_PauliSumLossBase): ...


class _GeneralizedTableauBase:
def __init__(
self,
n_qubits: int,
min_abs_coeff: float = 1e-10,
seed: int | None = None,
) -> None: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __copy__(self) -> "_GeneralizedTableauBase": ...
def __deepcopy__(self, memo: object) -> "_GeneralizedTableauBase": ...
def measure(self, addr0: int) -> bool | None: ...
def x(self, addr0: int) -> None: ...
def y(self, addr0: int) -> None: ...
def z(self, addr0: int) -> None: ...
def h(self, addr0: int) -> None: ...
def s(self, addr0: int) -> None: ...
def s_adj(self, addr0: int) -> None: ...
def sqrt_x(self, addr0: int) -> None: ...
def sqrt_x_adj(self, addr0: int) -> None: ...
def sqrt_y(self, addr0: int) -> None: ...
def sqrt_y_adj(self, addr0: int) -> None: ...
def cnot(self, addr0: int, addr1: int) -> None: ...
def cy(self, addr0: int, addr1: int) -> None: ...
def cz(self, addr0: int, addr1: int) -> None: ...
def t(self, addr0: int) -> None: ...
def t_adj(self, addr0: int) -> None: ...
def rx(self, addr0: int, theta: float) -> None: ...
def ry(self, addr0: int, theta: float) -> None: ...
def rz(self, addr0: int, theta: float) -> None: ...
def u3(self, addr0: int, theta: float, phi: float, lam: float) -> None: ...
def r(self, addr0: int, axis_angle: float, theta: float) -> None: ...
def rxx(self, addr0: int, addr1: int, theta: float) -> None: ...
def ryy(self, addr0: int, addr1: int, theta: float) -> None: ...
def rzz(self, addr0: int, addr1: int, theta: float) -> None: ...
def pauli_error(self, addr0: int, p: Sequence[float]) -> None: ...
def depolarize(self, addr0: int, p: float) -> None: ...
def depolarize2(self, addr0: int, addr1: int, p: float) -> None: ...
def two_qubit_pauli_error(
self, addr0: int, addr1: int, p: Sequence[float]
) -> None: ...
def loss_channel(self, addr0: int, p: float) -> None: ...
def correlated_loss_channel(
self, addr0: int, addr1: int, p: Sequence[float]
) -> None: ...
def reset_loss_channel(self, addr0: int) -> None: ...
def reset(self, addr0: int) -> None: ...
def is_lost(self, addr0: int) -> bool: ...
def loss_values(self) -> list[bool]: ...
def run(self, prog: "StimProgram") -> list[int]: ...
@staticmethod
def sample(
prog: "StimProgram",
n_qubits: int,
min_abs_coeff: float = 1e-10,
num_shots: int = 1,
seed: int | None = None,
) -> list[list[int]]: ...
def fork(self, seed: int | None = None) -> "_GeneralizedTableauBase": ...


class StimProgram:
@staticmethod
def parse(src: str) -> "StimProgram": ...
@staticmethod
def from_file(path: str) -> "StimProgram": ...
def __repr__(self) -> str: ...

Comment on lines +157 to +163

class GeneralizedTableau1(_GeneralizedTableauBase): ...
class GeneralizedTableau2(_GeneralizedTableauBase): ...
class GeneralizedTableau3(_GeneralizedTableauBase): ...
class GeneralizedTableau4(_GeneralizedTableauBase): ...
class GeneralizedTableau5(_GeneralizedTableauBase): ...
class GeneralizedTableau6(_GeneralizedTableauBase): ...
class GeneralizedTableau7(_GeneralizedTableauBase): ...
class GeneralizedTableau8(_GeneralizedTableauBase): ...
class GeneralizedTableau9(_GeneralizedTableauBase): ...
class GeneralizedTableau10(_GeneralizedTableauBase): ...
class GeneralizedTableau11(_GeneralizedTableauBase): ...
class GeneralizedTableau12(_GeneralizedTableauBase): ...
class GeneralizedTableau13(_GeneralizedTableauBase): ...
class GeneralizedTableau14(_GeneralizedTableauBase): ...
class GeneralizedTableau15(_GeneralizedTableauBase): ...
class GeneralizedTableau16(_GeneralizedTableauBase): ...
class GeneralizedTableau17(_GeneralizedTableauBase): ...
class GeneralizedTableau18(_GeneralizedTableauBase): ...
class GeneralizedTableau19(_GeneralizedTableauBase): ...
class GeneralizedTableau20(_GeneralizedTableauBase): ...
class GeneralizedTableau21(_GeneralizedTableauBase): ...
class GeneralizedTableau22(_GeneralizedTableauBase): ...
class GeneralizedTableau23(_GeneralizedTableauBase): ...
class GeneralizedTableau24(_GeneralizedTableauBase): ...
class GeneralizedTableau25(_GeneralizedTableauBase): ...
class GeneralizedTableau26(_GeneralizedTableauBase): ...
class GeneralizedTableau27(_GeneralizedTableauBase): ...
class GeneralizedTableau28(_GeneralizedTableauBase): ...
class GeneralizedTableau29(_GeneralizedTableauBase): ...
class GeneralizedTableau30(_GeneralizedTableauBase): ...
class GeneralizedTableau31(_GeneralizedTableauBase): ...
class GeneralizedTableau32(_GeneralizedTableauBase): ...
Loading