-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to generate keys for Qref type? #8
Comments
Hi @jakezweifler, if we are restricting ourselves (for now) to the solution presented in the Q-Algol paper, then the keys need to be generated while translating from Does that make sense? |
Ok, this makes sense but I am still unsure of how to proceed in terms of the type-checking since TQbit (in the Q# grammar) does not take any constructors. So when the key is generated how can it be associated to the type of the qubit? |
@jakezweifler Indeed, There is also, of course, the third case where we exit the scope of the qubit -- we need to pop the qubit from the signature stack and remove/invalidate all bindings in the context for that type. For this use case (qubit memory management), you can consider writing a couple of Q# programs manually and add them to the namespace QAlgol {
operation NewQubit () : Qubit {
use q = Qubit ();
return q;
}
operation Clone () : Unit {
use q1 = Qubit ();
let q2 = q1 ;
CNOT ( q1 , q2 );
}
} |
Related to #7, we want to map TQbit to TQref. In order to solve the no-cloning problem, TQref takes in a key, but how/when should these keys be generated? The key generation is a crucial part of lambda-Q# as it is necessary to ensure there are no unsafe programs.
The text was updated successfully, but these errors were encountered: