Coverage for /home/runner/work/tket/tket/pytket/pytket/utils/__init__.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-03-14 11:30 +0000

1# Copyright Quantinuum 

2# 

3# Licensed under the Apache License, Version 2.0 (the "License"); 

4# you may not use this file except in compliance with the License. 

5# You may obtain a copy of the License at 

6# 

7# http://www.apache.org/licenses/LICENSE-2.0 

8# 

9# Unless required by applicable law or agreed to in writing, software 

10# distributed under the License is distributed on an "AS IS" BASIS, 

11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

12# See the License for the specific language governing permissions and 

13# limitations under the License. 

14 

15"""Utility functions for performing high-level procedures in pytket""" 

16 

17from .distribution import ( 

18 EmpiricalDistribution, 

19 ProbabilityDistribution, 

20 convex_combination, 

21) 

22from .expectations import ( 

23 expectation_from_counts, 

24 expectation_from_shots, 

25 get_operator_expectation_value, 

26 get_pauli_expectation_value, 

27) 

28from .graph import Graph 

29from .measurements import append_pauli_measurement 

30from .operators import QubitPauliOperator 

31from .outcomearray import OutcomeArray, readout_counts 

32from .prepare import prepare_circuit 

33from .results import ( 

34 compare_statevectors, 

35 compare_unitaries, 

36 counts_from_shot_table, 

37 permute_basis_indexing, 

38 permute_qubits_in_statevector, 

39 permute_rows_cols_in_unitary, 

40 probs_from_counts, 

41 probs_from_state, 

42) 

43from .stats import gate_counts 

44from .symbolic import circuit_apply_symbolic_statevector, circuit_to_symbolic_unitary 

45from .term_sequence import gen_term_sequence_circuit