xir.Statement¶
- class Statement(name: str, params: Union[List[Union[complex, str, Decimal, DecimalComplex, bool, List[Param]]], Dict[str, Union[complex, str, Decimal, DecimalComplex, bool, List[Param]]]], wires: Sequence[Union[int, str]], **kwargs)[source]¶
Bases:
object
A general statement consisting of a name, optional parameters and wires.
This is used for gate statements (e.g.
rx(0.13) | [0]
) or output statements (e.g.sample(shots: 1000) | [0, 1]
).- Parameters
name (str) – name of the statement
params (list, Dict) – parameters for the statement (can be empty)
wires (tuple) – the wires on which the statement is applied
- Keyword Arguments
inverse (bool) – whether the statement is an inverse gate
ctrl_wires (tuple) – the control wires of a controlled gate statement
use_floats (bool) – Whether floats and complex types are returned instead of
Decimal
andDecimalComplex
objects. Defaults toTrue
.
Attributes
Returns the control wires of a controlled gate statement.
Returns whether the statement applies an inverse gate.
Returns the name of the statement.
Returns the parameters of the gate statement.
Returns whether floats and complex types are returned instead of
Decimal
andDecimalComplex
objects, respectively.Returns the wires that the gate is applied to.
- ctrl_wires¶
Returns the control wires of a controlled gate statement. If no control wires are specified, an empty tuple is returned.
- is_inverse¶
Returns whether the statement applies an inverse gate.
- name¶
Returns the name of the statement.
- params¶
Returns the parameters of the gate statement.
- use_floats¶
Returns whether floats and complex types are returned instead of
Decimal
andDecimalComplex
objects, respectively.
- wires¶
Returns the wires that the gate is applied to.