Skip to content

Commit

Permalink
Fix Qmods that use reserved word "phase" as variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
srulre committed Nov 14, 2024
1 parent 8c90d7e commit 8eec324
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions functions/open_library_definitions/amplitude_estimation.qmod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
qfunc amplitude_estimation(oracle: qfunc (qbit[]), space_transform: qfunc (qbit[]), phase: qnum, packed_vars: qbit[]) {
qfunc amplitude_estimation(oracle: qfunc (qbit[]), space_transform: qfunc (qbit[]), phase_var: qnum, packed_vars: qbit[]) {
space_transform(packed_vars);
qpe(lambda() {
grover_operator(oracle, space_transform, packed_vars);
}, phase);
}, phase_var);
}
4 changes: 2 additions & 2 deletions functions/open_library_definitions/qpe.qmod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
qfunc qpe(unitary: qfunc (), phase: qnum) {
qfunc qpe(unitary: qfunc (), phase_var: qnum) {
qpe_flexible(lambda(k) {
power (k) {
unitary();
}
}, phase);
}, phase_var);
}
6 changes: 3 additions & 3 deletions functions/open_library_definitions/qpe_flexible.qmod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
qfunc qpe_flexible(unitary_with_power: qfunc (int), phase: qnum) {
qfunc qpe_flexible(unitary_with_power: qfunc (int), phase_var: qnum) {
phase_array: qbit[];
phase -> phase_array;
phase_var -> phase_array;
apply_to_all(H, phase_array);
repeat (index: phase_array.len) {
control (phase_array[index]) {
Expand All @@ -10,5 +10,5 @@ qfunc qpe_flexible(unitary_with_power: qfunc (int), phase: qnum) {
invert {
qft(phase_array);
}
phase_array -> phase;
phase_array -> phase_var;
}

0 comments on commit 8eec324

Please sign in to comment.