q5m.js - Quantum Computing Library - v0.1.1
    Preparing search index...

    Function createAmplitude

    • Creates a validated amplitude from real and imaginary components. Throws if the magnitude is greater than 1.

      Parameters

      • real: number

        Real component

      • imag: number = 0

        Imaginary component (default: 0)

      Returns Complex

      Valid quantum amplitude

      Error if magnitude > 1