Skip to content

What is the point of the register_length() method? #1354

Description

@grossardt

(More a feature removal request, actually)

Both second_q.hamiltonians.hamiltonian.Hamiltonian and second_q.operators.SparseLabelOp (and accordingly all their children) require a .register_length() method. However, this method does not seem to be used anywhere at the moment? What is the point of having this method?
From a logical point of view, it seems weird to associate a register length with an operator, as the size of a qubit register should only be clear after mapping?

The docstrings are rather cryptic, with SparseLabelOp.register_length() simply saying: "Returns the register length" and Hamiltonian.register_length() the not much more informative "The size of the operator generated by the second_q_op method." How does one measure the size of an operator? Especially since SparseLabelOp is supposed to be rather generic and not make any assumptions about the types of string labels it holds, I am not really sure what I should expect from this method as a return value?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions