Module spinoza::utils

source ·
Expand description

An assortment of utility functions for visualizing, benchmarking, and testing.

Functions

  • Asserts that two floating point numbers are approximately equal.
  • Generates a random quantum state
  • Utility function for multiplying two 2 x 2 gates
  • Convert a usize to its binary expansion, but padded with 0’s. Padding is of size, width.
  • Formats an unsigned, 128 bit integer with commas, as a string. Used for readability
  • Swap using controlled X gates.
  • Display the State as a table