Coder Social home page Coder Social logo

pyqsp's People

Contributors

alibaba-oss avatar andrewktan avatar cupjinhuang avatar ichuang avatar jmmartyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyqsp's Issues

File `ham_sim.py` missing

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.

Non-determenistic behavior of PolySign + QuantumSignalProcessingPhases

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!

Instructions on how to cite

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.

StringPolynomial Issue for a general polynomial representation

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.