Skip to content

[Python] add Protocols for improved typing #50

@mrossinek

Description

@mrossinek

What should we add?

For typing purposes, it would be great to have a few Protocol definitions for the following scenarios:

  • describe Operator representations: FermionOperator, MajoranaOperator and future additions (see e.g. Edge-Vertex and Transfer-Vertex operator representations #8) all have some overlapping functionality without having some shared base-class. Within the Rust implementation, all of these share the OperatorTrait but we don't have a matching Protocol on the Python level. Adding this will greatly improve type-hinting across the package (e.g. in [EPIC] Circuit Library #5).
  • describe Mapper methods: I'm not yet sure whether we'd want to define certain mapping Protocols on the full API level, but this could also be useful in combination with the previous bullet point for implementing [EPIC] Circuit Library #5.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions