Skip to content
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

Phase polynomials #57

Merged
merged 14 commits into from
Jun 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added lifted decorator.
renezander90 committed Jun 12, 2024
commit 141637d9beceba8126e88280b0281061f5b2be20
6 changes: 3 additions & 3 deletions src/qrisp/arithmetic/SBP_arithmetic.py
Original file line number Diff line number Diff line change
@@ -1113,7 +1113,7 @@ def quantum_bit_shift(qf, bit_shift, treat_overflow = True):
cyclic_shift(qf, bit_shift)


#@lifted
@lifted
def app_sb_phase_polynomial(input_qf_list, poly, symbol_list=None, t=1):
"""
Applies a phase function specified by a (multivariate) SymPy polynomial on a list of QuantumVariables using
@@ -1239,7 +1239,7 @@ def app_sb_phase_polynomial(input_qf_list, poly, symbol_list=None, t=1):
gphase(y*t,input_qubits[0])


#@lifted
@lifted
def app_phase_polynomial(qf_list, poly, symbol_list=None, t=1):
"""
Applies a phase function specified by a (multivariate) SymPy polynomial on a list of QuantumFloats using
@@ -1340,7 +1340,7 @@ def app_phase_polynomial(qf_list, poly, symbol_list=None, t=1):
::

plt.plot(x_values, y_values, label = "P(x)")
plt.plot(phi , sv_phase_array%(2*np.pi), "o", label = "Simulated phases")
plt.plot(qf_values , sv_phase_array%(2*np.pi), "o", label = "Simulated phases")

plt.ylabel("Phase [radian]")
plt.xlabel("QuantumFloat outcome labels")