CriteriaInputParsing

braket.circuits.noise_model.criteria_input_parsing.parse_operator_input(operators)[source]

Processes the quantum operator input to __init__ to validate and return a set of QuantumOperators.

Parameters:

operators (QuantumOperator | Iterable[QuantumOperator]) – QuantumOperator input.

Return type:

set[QuantumOperator] | None

Returns:

set[QuantumOperator] | None – The set of relevant QuantumOperators or None if none is specified.

Throws:
ValueError: If no quantum operator are provided, if the quantum operator don’t all operate

on the same number of qubits.

braket.circuits.noise_model.criteria_input_parsing.parse_qubit_input(qubits, expected_qubit_count=0)[source]

Processes the qubit input to __init__ to validate and return a set of qubit targets.

Parameters:
  • qubits (QubitSetInput | None) – Qubit input.

  • expected_qubit_count (int | None) – The expected number of qubits that the input gates operates on. If the value is non-zero, this method will validate that the expected qubit count matches the actual qubit count. Default is 0.

Return type:

set[int | tuple[int]] | None

Returns:

set[int | tuple[int]] | None – The set of qubit targets, or None if no qubits are specified.