Skip to content

Inefficient allocation of ancilla qubits in PiecewiseLinearRotation and PolynomialLinearRotation #5322

@ankprd

Description

@ankprd

What is the expected enhancement?

In PiecewiseLinearRotation, only num_state_qubits - 1 + 1 ancillas are ever used at the same time (instead of num_ancillas = num_state_qubits - 1 + len(self.breakpoints)).
For each breakpoint, the exact same ancillas could be reused, instead of changing each time which ancilla are used (by using the i_compare index) (or another way to say it.: everything would work the same if i_compare was fixed to 0 all the time).

In PolynomialPauliRotation, only max(1, min(degree - 1, num_state_qubits - 2)) are needed, instead of num_ancillas = max(1, self.degree - 1). (Because where the ancillas are used, l.341, 343 and 345, we have that len(rotation_coeffs[c]) <= min(degree + 1, num_state_qubits))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions