[prototype] More classical data types #1717
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some ideas on how to handle the fact that for a given encoding we usually want both a quantum data type and classical data type. For example, QInt and CInt both encode mathematical integers into bits or qubits in the same way but in a circuit we want to distinguish between a quantum integer and a classical integer.
BitEncoding
abstract base classBitEncoding
I think it's important to have distinct objects for common quantum and classical data types e.g. QBit CBit QInt CInt. Maybe it's annoying to always have to define two classes for each BitEncoding (the quantum and classical one). You could use something like the
ClassicalVersion
meta-data-type in this PR. I'm worried that: right now data type compatibility isdt1 == dt2
but if we haveClassicalVersion(QInt)
representing the same thing asCInt
it gets complicated. Generally, I'd prioritize making the end user (quantum programmer)'s life easier with top-level quantum and classical versions of everything at the expense of the "developer" (introducer of new quantum data types) having to do some boilerplate.