MakeModularExponentiationError

public enum MakeModularExponentiationError : Error

Errors throwed by Gate.makeModularExponentiation(base:modulus:exponent:inputs:)

  • Throwed when base is 0 (or less). First, this implementation only works with a positive base. It also has to be different from 0 because if base is 0, the modulo is always 0 which would end up producing a non-unitary matrix

    Declaration

    Swift

    case baseHasToBeBiggerThanZero
  • Throwed if inputs is an empty list

    Declaration

    Swift

    case inputsCanNotBeAnEmptyList
  • Throwed when modulus is 1 (or less). First, this implementation only works with a positive modulus. It also has to be different from 0 because we can not divide by 0. And it can not be 1 because, regardless of base, the modulo of 1 is always 0 which would end up producing a non-unitary matrix

    Declaration

    Swift

    case modulusHasToBeBiggerThanOne
  • Throwed if it was not possible to build a unitary matrix with the provided modulus, most likely because modulus is a power of base

    Declaration

    Swift

    case modulusProducesANonUnitaryMatrix