quantumlib / Qualtran

Qᴜᴀʟᴛʀᴀɴ is a Python library for expressing and analyzing Fault Tolerant Quantum algorithms.
https://qualtran.readthedocs.io/en/latest/
Apache License 2.0
134 stars 35 forks source link

Symbolic bitsizes for splits / joins / partitions? #991

Open fdmalone opened 2 months ago

fdmalone commented 2 months ago

Does it make sense for these to have symbolic register sizes?

mpharrigan commented 1 month ago

The general philosophy is "as symbolic as possible". But: what would you expect the behavior to be here?

Things you can do:

fdmalone commented 1 month ago

I can't quite remember what I was thinking here, but I believe I had a case during block encoding where the register bitsize would potentially be symbolic but was needed for the input to the Partition bloq and then mypy was complaining, but I didn't think it necessarily made sense that Partition (or split / ..) expected a symbolic bitsize. In the end I rewrote the code so the issue didn't come up.