braket.circuits.quantum_operator module¶
-
class
braket.circuits.quantum_operator.
QuantumOperator
(qubit_count: int, ascii_symbols: Sequence[str])[source]¶ Bases:
braket.circuits.operator.Operator
A quantum operator is the definition of a quantum operation for a quantum device.
- Parameters
qubit_count (int) – Number of qubits this quantum operator interacts with.
ascii_symbols (Sequence[str]) – ASCII string symbols for the quantum operator. These are used when printing a diagram of circuits. Length must be the same as
qubit_count
, and index ordering is expected to correlate with target ordering on the instruction. For instance, if CNOT instruction has the control qubit on the first index and target qubit on the second index. Then ASCII symbols would have [“C”, “X”] to correlate a symbol with that index.
- Raises
ValueError –
qubit_count
is less than 1,ascii_symbols
are None, orascii_symbols
length !=qubit_count
-
property
qubit_count
¶ Returns number of qubits this quantum operator interacts with.
- Type
int
-
property
ascii_symbols
¶ Returns the ascii symbols for the quantum operator.
- Type
List[str]
-
property
name
¶ Returns the name of the quantum operator
- Returns
The name of the quantum operator as a string
-
to_ir
(*args, **kwargs) → Any[source]¶ Returns IR representation of quantum operator
- Parameters
*args – Positional arguments
**kwargs – Keyword arguments