Git Product home page Git Product logo

Comments (5)

cgranade avatar cgranade commented on May 18, 2024

Possible action items for resolving type specializations of arbitrary state preparation:

  • Deprecate StatePreparationComplexCoefficients, as this function simply partially applies PrepareArbitraryState, and is currently only used to in cases such as:
(StatePreparationComplexCoefficients(coefficientsNewComplexPolar))(LittleEndian(auxillary));
  • Deprecate StatePreparationPositiveCoefficients in favor of a new PrepareArbitraryStateD and rename PrepareArbitraryState to PrepareArbitraryStateCP.

from quantumlibraries.

tcNickolas avatar tcNickolas commented on May 18, 2024

Thank you for this systematic approach!

One more thing in this library I've seen confuse people is that the operations only describe what happens if the input state is 0...0. It's unclear what happens if the input state is different - does the operation fail altogether, does it reset all qubits to 0 before preparing the state, does it apply some kind of transformation that ends up not preparing this state? It would be very helpful to clarify this.

from quantumlibraries.

cgranade avatar cgranade commented on May 18, 2024

@tcNickolas: No worries, happy to continue the work done with the amplitude amplification namespace with this namespace as well; thanks for highlighting preparation as an area of interest so that I can prioritize accordingly.

As for the point about states other than |00⋯0⟩, my approach thus far has been that the meaning of the "Prepare" verb is only well-defined for a particular initial state (|00⋯0⟩ for bare registers, |0⟩ for little-endian registers, and so forth), such that acting on other input states is undefined behavior. That is, "Prepare" operations generally act more like partial isometries than unitaries. Where additional specific behavior can be reasonably defined (e.g.: preparing a Bell state with an input of |10⟩ makes perfect sense, and should prepare (|00⟩ − |11⟩) √2), that should be called out in API documentation comments as a /// # Remarks section.

I think it's a bit hard to enforce that input registers are passed in the right input states, as that could introduce a significant number of additional Reset or ResetAll operations, and would make it harder to use Adjoint of a preparation to represent something that coherently unprepares a given state. Similarly, resetting would make it hard to use controlled preparations common in distinguishability tests (e.g.: using the Hadamard test to tell if the states prepared by two different operations are approximately the same or not; for the SWAP test you wouldn't need controllability). It may similarly be suboptimal to use assertions to enforce on a simulator, but I think that would be the best alternative should we want to avoid undefined behavior.

It may be helpful to clarify that, then, as part of the namespace description, and in the forthcoming API principles.

from quantumlibraries.

cgranade avatar cgranade commented on May 18, 2024

Apologies @KittyYeungQ, I forgot to tag you in for awareness on the point about documenting the meaning of the verb "Prepare."

from quantumlibraries.

cgranade avatar cgranade commented on May 18, 2024

Closed with #344.

from quantumlibraries.

Related Issues (20)

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.