-
Notifications
You must be signed in to change notification settings - Fork 1
2. 🏗️ Features to implement
Gabriele Messina edited this page Mar 22, 2024
·
1 revision
//This ifelse should create a controlled custom gate
if(grover_find()){
//do quantum operations
}
else{
//do other quantum operations
}
//This ifelse could convert all classical operations to quantum or cause a measure.
if(grover_find()){
//do a mix of classical and quantum operations
}
else{
//do other mix of classical and quantum operations
}
quint a = 1q;
qubit b = (qubit)a;
quint a = 0q;
qubit b = (qubit)a;
if(a){ //This should throw
}
if(b){ //This should be false
}
if(a > b){ //This and other comparing operators should be implemented for both qubit and quint
}
//In this case, we must execute a piece of code in a quantum realm and another piece on a classical CPU before returning to a quantum circuit.
//It's not clear how we should handle this. Should this be transparent to the user? Should we make it more straightforward that a measurement is needed to sum 'input' and 'x'
{
quint x = 10q;
if(x > 0){
string input = classical_read_user_input(); //just an explanatory example for a function that cannot run on a quantum circuit and must run on a classic CPU.
x += (int)input;
}
x = quantum_sqrt(x);
measure x;
}
//These two blocks can be two different circuits.
{
qubit a = [true]q;
qubit b = [true]q;
quint x = a + b;
measure x;
}
{
quint a = 10q;
quint d = 4q;
quint re = a + c;
measure re;
}
//-----------
//These two blocks cannot be two different circuits because they use the same global variable.
//But we can say that we have two custom gates in the circuit,
//So if a custom gate takes nothing as input, it's a new circuit.
qubit a = [1]q;
{
qubit b = [1]q;
quint x = a + b;
measure x;
}
{
quint b = 10q;
quint re = b + a;
measure re;
}
//This could be implemented as a custom gate of the quantum circuit, but we need to handle the parameters allocation, release and the scope of the variables.
public quint sum(quint a, quint b){
return a + b;
}