ichuang / pyqsp Goto Github PK
View Code? Open in Web Editor NEWPython quantum signal processing
License: Other
Python quantum signal processing
License: Other
The code description says "ham_sim.py
shows an example of how the angle sequence for Hamiltonian simulation can be found." but the file seems to be missing from the repository.
Hi,
Thank you for open-sourcing this code!
I would love to understand why QuantumSignalProcessingPhases
is non-deterministic for the same polynomial.
For example:
import pyqsp
from pyqsp import angle_sequence
from numpy.polynomial.polynomial import Polynomial
poly = pyqsp.poly.PolySign().generate(degree=5, delta=10.0)
print(repr(poly))
for i in range(5):
phis = pyqsp.angle_sequence.QuantumSignalProcessingPhases(poly)
print(phis)
Produces:
[pyqsp.poly.PolySign] degree=5, delta=10.0
[PolyTaylorSeries] max [0.9] is at [1.]: normalizing
[PolyTaylorSeries] average error = 0.21930741075851684 in the domain [-1, 1] using degree 5
TargetPolynomial([ 0. , 2.42154, 0. , -2.8077 , 0. , 1.28616], domain=[-1, 1], window=[-1, 1])
[-0.1953070756439737, 0.2597197965037532, -1.0753701746905036, -1.0753701746905047, 0.2597197965037523, 1.3754892511509227]
[-0.08086819012861554, 0.2692339694770634, -0.748204652312621, -0.7482046523126189, 0.2692339694770627, 1.4899281366662787]
[-0.08086819012861554, 0.2692339694770634, -0.748204652312621, -0.7482046523126189, 0.2692339694770627, 1.4899281366662787]
[-1.3974820311242748, -0.5688243732627165, 0.9553489505562665, 0.9553489505562655, -0.5688243732627172, 0.17331429567062237]
[-1.3754892511509236, -0.25971979650375365, 1.0753701746905024, 1.0753701746905044, -0.2597197965037502, 0.19530707564397418]
Maybe I'm wrong about my expectation around it being deterministic?
It is absolutely not urgent, I'm working through the Martyn et al Grand unification of quantum algorithms paper and ran into this issue.
Thank you!
Hello,
First of all, thank you for making pyqsp
public. The Quantum Signal Processing theory is already phenomenal, but, as evidenced by Chao et al., and as shown by the existance of pyqsp
in the first place, it would be very complicated to get started in practice without this package.
Per the introduction section of the README, since the package borrows and extends techniques from multiple publications, I would appreciate if there were explicit citation instructions, to reference when using the package in the context of other work.
Hi!
I was trying to play with the example for an arbitrary function specified as a string using a numpy
expression when run into an issue for the code line (poly + Polynomial([0, ] * poly.degree() + [eps / 2, ]))
TypeError: unsupported operand type(s) for +: 'StringPolynomial' and 'Polynomial'
My code followed exactly the example provided in the repo:
poly = pyqsp.poly.StringPolynomial("np.cos(3*x)", 6)
ang_seq = pyqsp.angle_sequence.QuantumSignalProcessingPhases(poly)
pyqsp.response.PlotQSPResponse(ang_seq, target=poly, signal_operator="Wx")
Are there missing lines of code that convert a string representation of a function to a function or am I doing something wrong here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.