QGFPoly#

qualtran.QGFPoly

Univariate Polynomials with coefficients in a Galois Field GF(\(p^m\)).

Inherits From: QDType, QCDType

This data type represents a degree-\(n\) univariate polynomials \(f(x)=\sum_{i=0}^{n} a_i x^{i}\) where the coefficients \(a_{i}\) of the polynomial belong to a Galois Field \(GF(p^{m})\).

The data type uses the Galois library to perform arithmetic over polynomials defined over Galois Fields using the galois.Poly. References Polynomials over finite fields

[Polynomial Arithmetic](https://mhostetter.github.io/galois/latest/basic-usage/poly-arithmetic/)
degree

The degree \(n\) of the univariate polynomial \(f(x)\) represented by this type.

qgf

An instance of QGF that represents the galois field \(GF(p^m)\) over which the univariate polynomial \(f(x)\) is defined.

bitsize

 

num_bits

 

num_cbits

Number of classical bits required to represent a single instance of this data type.

num_qubits

Number of qubits required to represent a single instance of this data type.

Methods#

get_classical_domain

View source

Yields all possible classical (computational basis state) values representable by this type.

to_gf_coefficients

View source

Returns a big-endian array of coefficients of the polynomial f(x).

from_gf_coefficients

View source

Expects a big-endian array of coefficients that represent a polynomial f(x).

to_bits

View source

Returns individual bits corresponding to binary representation of x

from_bits

View source

Combine individual bits to form x

assert_valid_classical_val

View source

Raises an exception if val is not a valid classical value for this type.

Args

val

A classical value that should be in the domain of this QDType.

debug_str

Optional debugging information to use in exception messages.

is_symbolic

View source

Returns True if this qdtype is parameterized with symbolic objects.

iteration_length_or_zero

View source

Safe version of iteration length.

Returns the iteration_length if the type has it or else zero.

__ne__

Check equality and either forward a NotImplemented or return the result negated.

__eq__

Method generated by attrs for class QGFPoly.