MakeModularExponentiationError
public enum MakeModularExponentiationError : Error
Errors throwed by Gate.makeModularExponentiation(base:modulus:exponent:inputs:)
-
Throwed when
baseis 0 (or less). First, this implementation only works with a positivebase. It also has to be different from 0 because ifbaseis 0, the modulo is always 0 which would end up producing a non-unitary matrixDeclaration
Swift
case baseHasToBeBiggerThanZero -
Throwed if
inputsis an empty listDeclaration
Swift
case inputsCanNotBeAnEmptyList -
Throwed when
modulusis 1 (or less). First, this implementation only works with a positivemodulus. It also has to be different from 0 because we can not divide by 0. And it can not be 1 because, regardless ofbase, the modulo of 1 is always 0 which would end up producing a non-unitary matrixDeclaration
Swift
case modulusHasToBeBiggerThanOne -
Throwed if it was not possible to build a unitary matrix with the provided
modulus, most likely becausemodulusis a power ofbaseDeclaration
Swift
case modulusProducesANonUnitaryMatrix
MakeModularExponentiationError Enumeration Reference