-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing typing stubs, so mypy check passes
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Type stubs for the Rust bindings | ||
|
||
from typing import final | ||
|
||
@final | ||
class VecGraph: | ||
def vindex(self) -> int: ... | ||
def neighbor_at(self, v: int, n: int) -> int: ... | ||
def num_vertices(self) -> int: ... | ||
def num_edges(self) -> int: ... | ||
def add_vertex( | ||
self, ty_num: int, qubit: int, row: int, phase: tuple[int, int] | ||
) -> int: ... | ||
def contains_vertex(self, v: int) -> bool: ... | ||
def add_edge(self, e: tuple[int, int], et_num: int) -> None: ... | ||
def add_edge_smart(self, e: tuple[int, int], et_num: int) -> None: ... | ||
def remove_vertex(self, v: int) -> None: ... | ||
def remove_edge(self, e: tuple[int, int]) -> None: ... | ||
def degree(self, v: int) -> int: ... | ||
def connected(self, s: int, t: int) -> bool: ... | ||
def vertex_type(self, v: int) -> int: ... | ||
def set_vertex_type(self, v: int, ty_num: int) -> None: ... | ||
def edge_type(self, e: tuple[int, int]) -> int: ... | ||
def set_edge_type(self, e: tuple[int, int], et_num: int) -> None: ... | ||
def phase(self, v: int) -> tuple[int, int]: ... | ||
def set_phase(self, v: int, phase: tuple[int, int]) -> None: ... | ||
def add_to_phase(self, v: int, phase: tuple[int, int]) -> None: ... | ||
def qubit(self, v: int) -> int: ... | ||
def set_qubit(self, v: int, q: int) -> None: ... | ||
def row(self, v: int) -> int: ... | ||
def set_row(self, v: int, r: int) -> None: ... | ||
def inputs(self) -> list[int]: ... | ||
def num_inputs(self) -> int: ... | ||
def set_inputs(self, inputs: list[int]) -> None: ... | ||
def outputs(self) -> list[int]: ... | ||
def num_outputs(self) -> int: ... | ||
def set_outputs(self, outputs: list[int]) -> None: ... | ||
|
||
@final | ||
class Circuit: | ||
@staticmethod | ||
def from_qasm(qasm: str) -> Circuit: ... | ||
@staticmethod | ||
def load(file: str) -> Circuit: ... | ||
def to_qasm(self) -> str: ... | ||
def to_graph(self) -> VecGraph: ... | ||
def num_gates(self) -> int: ... | ||
def stats(self) -> str: ... | ||
|
||
@final | ||
class CircuitStats: | ||
def qubits(self) -> int: ... | ||
def total(self) -> int: ... | ||
def oneq(self) -> int: ... | ||
def twoq(self) -> int: ... | ||
def moreq(self) -> int: ... | ||
def cliff(self) -> int: ... | ||
def non_cliff(self) -> int: ... | ||
def to_string(self) -> str: ... | ||
|
||
@final | ||
class Decomposer: | ||
@staticmethod | ||
def empty() -> Decomposer: ... | ||
def __init__(self, g: VecGraph) -> None: ... | ||
def graphs(self) -> list[VecGraph]: ... | ||
def apply_optimizations(self, b: bool) -> None: ... | ||
def max_terms(self) -> int: ... | ||
def decomp_top(self) -> None: ... | ||
def decomp_all(self) -> None: ... | ||
def decomp_until_depth(self, depth: int) -> None: ... | ||
|
||
def dummy(a: int) -> str: ... | ||
def interior_clifford_simp(g: VecGraph): ... | ||
def clifford_simp(g: VecGraph): ... | ||
def full_simp(g: VecGraph): ... | ||
def extract_circuit(g: VecGraph) -> Circuit: ... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters