tangelo.helpers package

Submodules

tangelo.helpers.math module

This file provides utility functions to perform mathematical operations.

tangelo.helpers.math.arrays_almost_equal_up_to_global_phase(array1, array2, atol=1e-06)

Checks if two arrays are almost equal up to a global phase.

Parameters:
  • array1 (array) – Self-explanatory.

  • array2 (array) – Self-explanatory.

  • atol (float) – Optional, absolute tolerance

Returns:

bool – True if arrays are almost equal up to a global phase, False otherwise.

tangelo.helpers.math.bool_col_echelon(bool_array)

Function to transform a boolean array into its column echelon form (transpose of the row-echelon form).

Parameters:

bool_array (array of bool) – Self-explanatory.

tangelo.helpers.utils module

This file provides miscellaneous utility functions and sets up variables to facilitate testing.

class tangelo.helpers.utils.HiddenPrints

Bases: object

Class to hide terminal printing with a ‘with’ block.

tangelo.helpers.utils.assert_freq_dict_almost_equal(d1, d2, atol)

Utility function to check whether two frequency dictionaries are almost equal, for arbitrary tolerance

tangelo.helpers.utils.deprecated(custom_message='')

This is a decorator which can be called to mark functions as deprecated. It results in a warning being emitted when the function is used.

Ref: https://stackoverflow.com/a/30253848

Parameters:

custom_message (str) – Message to append to the deprecation warning.

tangelo.helpers.utils.is_package_installed(package_name)

Check if module is installed without importing.

Module contents