PolyExt

The PolyExt dialect is a place for “external” operations on mlir::heir::polynomial::Polynomial.

PolyExt ops

poly_ext.cmod_switch (heir::poly_ext::CModSwitchOp)

Move polynomial into a ring with different cmod by scaling polynomial coefficients proportionally

Syntax:

operation ::= `poly_ext.cmod_switch` $x attr-dict `:` type($x) `->` type($output)

poly_ext.cmod_switch “moves” polynomial $x$ from ring $Z/QZ[X]/(f(x))$ to the ring $Z/qZ[X]/(f(x))$. The move is done by scaling the polynomial coefficients by $q/Q$ and “rounding” so input and output coufficients are congruent modulo congruence_modulus $t$. The resulting polynomial $\tilde{x} \approx (q/Q)x$ and $\tilde{x} \equiv x \mod t$.

Traits: AlwaysSpeculatableImplTrait, Elementwise, Scalarizable, Tensorizable, Vectorizable

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
congruence_modulus::mlir::IntegerAttrAn Attribute containing a integer value

Operands:

OperandDescription
xpolynomial-like

Results:

ResultDescription
outputpolynomial-like