https://github.com/quantumlib/cirq-qubitization/pull/204 implements the first end to end resource estimation example from the linear T paper. However, this PR leaves behind a bunch of improvements that need to be made in order to "productionize" the code. This issue is to track these improvements:
[ ] Pull out Heisenberg limited phase estimation into a GateWithRegisters class and write tests.
[x] Create interfaces for SELECT and PREPARE and generalize the QubitizationWalkOperator to work for other implementations of SELECT and PREPARE.
[ ] Pull out factory methods like get_walk_operator_for_1d_ising_model from the test files into core code; probably as part of a new hamiltonians subdirectory and ising_hamiltonian.py file? Or find a better place.
[ ] Find a way to handle power more generally for all gates?
[ ] Improve unary iteration and other derivate gates to support more general control_values instead of only supporting control_bitsize.
[ ] Improve gate.controlled() method implementation for GateWithRegisters like GenericSelect, WalkOperator etc.
[ ] Consider renaming QubitizationWalkOperator to something shorter?
[ ] Make gates (wherever possible) a frozen dataclass with a cached hash value (potentially using @attrs.define(frozen=True, cache_hash=True)) to speed up the T-complexity protocol for larger cases.
[ ] Right now, the T-complexity protocol does not pass it's _cache to the _t_complexity_ method defined by gates / operations. As a result, if a gate is recursively defined (for eg: qubitization walk operator with power > 1); then implementing it's _t_complexity_ protocol in terms of another subgate (eg: t_complexity(sub_gate) * power) doesn't make use of the cache and ends up being slower than the naive _decompose_ fallback. This should be made better as performance starts becoming an issue.
[ ] StatePreperationAliasSampling's constructor has some "logic" being done in it. Should we change this to just take alt,keep,mu and move the existing constructor to a factory class method?
https://github.com/quantumlib/cirq-qubitization/pull/204 implements the first end to end resource estimation example from the linear T paper. However, this PR leaves behind a bunch of improvements that need to be made in order to "productionize" the code. This issue is to track these improvements:
GateWithRegisters
class and write tests.SELECT
andPREPARE
and generalize theQubitizationWalkOperator
to work for other implementations ofSELECT
andPREPARE
.get_walk_operator_for_1d_ising_model
from the test files into core code; probably as part of a newhamiltonians
subdirectory andising_hamiltonian.py
file? Or find a better place.power
more generally for all gates?control_values
instead of only supportingcontrol_bitsize
.gate.controlled()
method implementation forGateWithRegisters
likeGenericSelect
,WalkOperator
etc.QubitizationWalkOperator
to something shorter?@attrs.define(frozen=True, cache_hash=True)
) to speed up the T-complexity protocol for larger cases._cache
to the_t_complexity_
method defined by gates / operations. As a result, if a gate is recursively defined (for eg: qubitization walk operator withpower > 1
); then implementing it's_t_complexity_
protocol in terms of another subgate (eg:t_complexity(sub_gate) * power
) doesn't make use of the cache and ends up being slower than the naive_decompose_
fallback. This should be made better as performance starts becoming an issue.