loom.eka.utilities.validation_tools

Copyright 2024 Entropica Labs Pte Ltd

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

loom.eka.utilities.validation_tools.coordinate_length_error(list_of_coordinates)[source]

Check if the length of the lists in the list are consistent.

Return type:

tuple[tuple, ...]

loom.eka.utilities.validation_tools.distinct_error(value)[source]

Check if the elements in a list or tuple are distinct. Throw an error otherwise.

loom.eka.utilities.validation_tools.empty_list_error(list_obj)[source]

Check if the list is empty. Throw an error if that is the case.

loom.eka.utilities.validation_tools.ensure_tuple(list_obj)[source]

Adjusts lists to tuples to ensure immutability of the data structures.

loom.eka.utilities.validation_tools.larger_than_zero_error(value, arg_name)[source]

Check if the value is larger than zero.

loom.eka.utilities.validation_tools.no_name_error(name)[source]

Check if the name is not empty.

Return type:

str

loom.eka.utilities.validation_tools.nr_of_qubits_error(qubits, values)[source]

Check if the number of qubits is consistent with the length of the pauli string.

This field_validator is used for objects that include a pauli field.

loom.eka.utilities.validation_tools.pauli_error(pauli_str)[source]

Check if the pauli is a valid pauli string.

Return type:

str

loom.eka.utilities.validation_tools.retrieve_field(name, info)[source]

Retrieve a field from the info object.

loom.eka.utilities.validation_tools.uuid_error(uuid_str)[source]

Check if the uuid is a valid uuid.

Return type:

str