QubitInitializationCriteria

class braket.circuits.noise_model.qubit_initialization_criteria.QubitInitializationCriteria(qubits=None)[source]

Bases: InitializationCriteria

This class models initialization noise Criteria based on qubits.

Parameters:

qubits (Union[Qubit, int, Iterable[Union[Qubit, int]], None])

Creates initialization noise Qubit-based Criteria.

Parameters:

qubits (QubitSetInput | None) – A set of relevant qubits. If no qubits are provided, all (possible) qubits are considered to be relevant.

applicable_key_types()[source]

Gets the QUBIT criteria key.

Return type:

Iterable[CriteriaKey]

Returns:

Iterable[CriteriaKey] – This Criteria operates on Qubits, but is valid for all Gates.

get_keys(key_type)[source]

Gets the keys for a given CriteriaKey.

Parameters:

key_type (CriteriaKey) – The relevant Criteria Key.

Return type:

CriteriaKeyResult | set[Any]

Returns:

CriteriaKeyResult | set[Any] – The return value is based on the key type: QUBIT will return a set of qubit targets that are relevant to this Criteria, or CriteriaKeyResult.ALL if the Criteria is relevant for all (possible) qubits. All other keys will return an empty set.

to_dict()[source]

Converts a dictionary representing an object of this class into an instance of this class.

Return type:

dict

Returns:

dict – A dictionary representing the serialized version of this Criteria.

qubit_intersection(qubits)[source]

Returns subset of passed qubits that match the criteria.

Parameters:

qubits (QubitSetInput) – A qubit or set of qubits that may match the criteria.

Return type:

Union[Qubit, int, Iterable[Union[Qubit, int]]]

Returns:

QubitSetInput – The subset of passed qubits that match the criteria.

classmethod from_dict(criteria)[source]

Deserializes a dictionary into a Criteria object.

Parameters:

criteria (dict) – A dictionary representation of a QubitCriteria.

Return type:

Criteria

Returns:

Criteria – A deserialized QubitCriteria represented by the passed in serialized data.