Compute PauliStringLCU tolerances from energy error - #101
Conversation
BrendanKKrueger
left a comment
There was a problem hiding this comment.
I'm glad this is finally being added! I've been bothered by this lack for a long time, but never knew enough to implement it myself. Thanks!
| algorithm.method = "QPE: pyLIQTR qubitized" | ||
| # algorithm.method = "QPE: qualtran qubitization" | ||
| algorithm.num_phase_qubits = 12 | ||
| # algorithm.num_phase_qubits = 12 |
There was a problem hiding this comment.
Probably better to just delete the line instead of commenting it out and leaving it in place
| class PauliStringLCU(LCUBlockEncoding): | ||
|
|
||
| def __init__(self, hamiltonian, prepare_type=None, probability_eps=0.002, **kwargs): | ||
| def __init__(self, hamiltonian, prepare_type=None, energy_error=0.001, **kwargs): |
There was a problem hiding this comment.
Does a default value make sense, or could that lead to subtle errors where the user doesn't specify energy_error for some reason and gets the wrong energy error value?
There was a problem hiding this comment.
Good catch, the default value probably doesn't make sense. Will remove.
BrendanKKrueger
left a comment
There was a problem hiding this comment.
I'm glad this is finally being added! I've been bothered by this lack for a long time, but never knew enough to implement it myself. Thanks!
This changes the epsilon and num_phase_qubits values for PauliStringLCU calculations (in both Qualtran and PyLIQTR) from hardcoded values to values computed based on the energy_error config parameter, based on @johngolden's suggested fixes.