Skip to content

Design Proposal for ModArith centered representatives #3055

@crockeea

Description

@crockeea

Basis conversion should normally (always?) use centered representatives in (-q/2, q/2). However, it currently relies on ModArith:ExtractOp, which yields the standard representative in [0,q) (assuming it was normalized with ModArith:ReduceOp first?). I'm proposing the following design to resolve this situtation:

I propose a new ModArith:LiftOp which is similar to ExtractOp, but parameterized by a new ModArith Enum with values centered or standard. There would be a transform that lowers LiftOp into other ModArith and Arith ops. If the parameter is standard, LiftOp lowers to ReduceOp followed by ExtractOp. If the parameter is centered, it lowers to ReduceOp, ExtractOp, and a conditional subtraction by q.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions