Constant

import

import { Constant } from "@masabando/quantum-gates"

Description

The Constant class provides predefined constant values used in quantum computing calculations.

Constants

PI

Constant.PI : number

Represents the mathematical constant π (pi), approximately equal to 3.14159.

E

Constant.E : number

Represents the mathematical constant e (Euler's number), approximately equal to 2.71828.

COMPLEX_I

Constant.COMPLEX_I : Complex

Represents the imaginary unit i (Complex(0, 1)).

COMPLEX_ONE

Constant.COMPLEX_ONE : Complex

Represents the complex number 1 (Complex(1, 0)).

COMPLEX_ZERO

Constant.COMPLEX_ZERO : Complex

Represents the complex number 0 (Complex(0, 0)).

PAULI_X

Constant.PAULI_X : QMatrix

Represents the Pauli-X (NOT) gate matrix.

PAULI_Y

Constant.PAULI_Y : QMatrix

Represents the Pauli-Y gate matrix.

PAULI_Z

Constant.PAULI_Z : QMatrix

Represents the Pauli-Z gate matrix.

Static Methods

identity

Constant.identity(dim: number) : QMatrix

Returns the identity matrix of dimension dim.

zero

Constant.zero(dim: number) : QMatrix

Returns the zero matrix of dimension dim.