Skip to content

Traits for scalars #3

@tbetcke

Description

@tbetcke

How should we define the scalar trait? I'd like to keep it very general. It would be cool for example to support operators over finite fields, etc.

The Num create provides a fairly generic numerical trait: https://docs.rs/num-traits/latest/num_traits/trait.Num.html.

However, this still requires a bit too much (e.g. it has string conversion and NumOps has remainder computations).

What do we minimally want to support for scalar fields? Initial suggestions:

  • A Zero element
  • A One element
  • Addition
  • Multiplication
  • Divison
  • PartialEq

Should we have less or more?

Also, it may be useful to have a separate complex trait that implements the above operations but whose real and imaginary parts are again numerical traits with the above property.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions