Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
81 changes: 80 additions & 1 deletion quil-rs/python/quil/instructions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,40 @@ class Declaration:
def to_quil(self) -> builtins.str: ...
def to_quil_or_debug(self) -> builtins.str: ...

class DefGateSequence:
r"""
A sequence of gates that make up a defined gate (i.e. with `DEFGATE ... AS SEQUENCE`).
"""
@property
def gates(self) -> builtins.list[Gate]:
r"""
The list of `Gate` objects that make up the sequence.
"""
@property
def qubits(self) -> builtins.list[builtins.str]:
r"""
The list of qubit variable names in the gate signature.
"""
def __eq__(self, other:builtins.object) -> builtins.bool: ...
def __getnewargs__(self) -> tuple[builtins.list[builtins.str], builtins.list[Gate]]: ...
def __hash__(self) -> builtins.int: ...
def __new__(cls, qubits:typing.Sequence[builtins.str], gates:typing.Sequence[Gate]) -> DefGateSequence:
r"""
Creates a new `DefGateSequence` with the given qubits and gates.

`qubits` should be a list of qubit names that the gates in the sequence will act on.
`gates` should be a list of `Gate` objects that make up the sequence.
Each gate must reference qubits in the `qubits` list by name.
They may not specify a fixed qubit.
"""
def __repr__(self) -> builtins.str: ...

class DefGateSequenceError(InstructionError):
r"""
Errors that can occur when initializing a sequence gate definition.
"""
...

class Delay:
@property
def duration(self) -> Expression: ...
Expand Down Expand Up @@ -671,6 +705,8 @@ class GateDefinition:
@property
def parameters(self) -> builtins.list[builtins.str]: ...
@property
def signature(self) -> GateSignature: ...
@property
def specification(self) -> GateSpecification: ...
def __eq__(self, other:builtins.object) -> builtins.bool: ...
def __getnewargs__(self) -> tuple[builtins.str, builtins.list[builtins.str], GateSpecification]: ...
Expand All @@ -686,11 +722,30 @@ class GateError(QuilError):
"""
...

class GateSignature:
r"""
A signature for a gate definition; this does not include the gate definition content.
To get a signature from a definition, use `GateDefinition.signature`.
"""
@property
def gate_parameters(self) -> builtins.list[builtins.str]: ...
@property
def gate_type(self) -> GateType: ...
@property
def name(self) -> builtins.str: ...
@property
def qubit_parameters(self) -> builtins.list[builtins.str]: ...
def __eq__(self, other:builtins.object) -> builtins.bool: ...
def __getnewargs__(self) -> tuple[builtins.str, builtins.list[builtins.str], builtins.list[builtins.str], GateType]: ...
def __hash__(self) -> builtins.int: ...
def __new__(cls, name:builtins.str, gate_parameters:typing.Sequence[builtins.str], qubit_parameters:typing.Sequence[builtins.str], gate_type:GateType) -> GateSignature: ...
def __repr__(self) -> builtins.str: ...

class GateSpecification:
r"""
An enum representing a the specification of a [`GateDefinition`] for a given [`GateType`]
"""
def __getnewargs__(self) -> tuple[list[list[Expression]] | list[int] | PauliSum]: ...
def __getnewargs__(self) -> tuple[list[list[Expression]] | list[int] | PauliSum | DefGateSequence]: ...
def __repr__(self) -> builtins.str: ...
def to_quil(self) -> builtins.str: ...
def to_quil_or_debug(self) -> builtins.str: ...
Expand Down Expand Up @@ -728,6 +783,17 @@ class GateSpecification:
def __len__(self) -> builtins.int: ...
def __new__(cls, _0:typing.Sequence[builtins.int]) -> GateSpecification.Permutation: ...

class Sequence(GateSpecification):
r"""
A sequence of gates.
"""
__match_args__ = ("_0",)
@property
def _0(self) -> DefGateSequence: ...
def __getitem__(self, key:builtins.int) -> typing.Any: ...
def __len__(self) -> builtins.int: ...
def __new__(cls, _0:DefGateSequence) -> GateSpecification.Sequence: ...


class Include:
@property
Expand Down Expand Up @@ -1748,6 +1814,19 @@ class GateModifier(Enum):
def to_quil(self) -> builtins.str: ...
def to_quil_or_debug(self) -> builtins.str: ...

class GateType(Enum):
r"""
The type of a [`GateDefinition`] used within the [`GateSignature`].
"""
MATRIX = ...
PERMUTATION = ...
PAULI_SUM = ...
SEQUENCE = ...

def __repr__(self) -> builtins.str: ...
def to_quil(self) -> builtins.str: ...
def to_quil_or_debug(self) -> builtins.str: ...

class PauliGate(Enum):
I = ...
X = ...
Expand Down
Loading
Loading