Comments (5)
Possible action items for resolving type specializations of arbitrary state preparation:
- Deprecate
StatePreparationComplexCoefficients
, as this function simply partially appliesPrepareArbitraryState
, and is currently only used to in cases such as:
(StatePreparationComplexCoefficients(coefficientsNewComplexPolar))(LittleEndian(auxillary));
- Deprecate
StatePreparationPositiveCoefficients
in favor of a newPrepareArbitraryStateD
and renamePrepareArbitraryState
toPrepareArbitraryStateCP
.
from quantumlibraries.
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.
@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.
Apologies @KittyYeungQ, I forgot to tag you in for awareness on the point about documenting the meaning of the verb "Prepare."
from quantumlibraries.
Closed with #344.
from quantumlibraries.
Related Issues (20)
- Different results appear when running the same program on different OS HOT 1
- The implementation of `Sqrt` is inadequate HOT 1
- Faster Amplitude Estimation Q# Library HOT 1
- 📦
- H
- Details or example lacking for ResultArrayAsInt function HOT 5
- LE and BE will modify the order of qubit register HOT 4
- A problem about qubit register release HOT 3
- A Wrong Check for the argument in `IdenticalPointPosFactFxP` HOT 1
- Error length of the array in example code HOT 5
- The operation matrix is not correct for PauliY gate HOT 2
- New checks are required in SequenceL and SequenceI HOT 1
- Questions about the DoubleAsFixedPoint function running out of memory
- PrepareSparseMultiConfigurationalState function excitations is empty array out of memory error
- The DumpRegister function document is inconsistent with the output of the terminal when quantum entanglement occurs
- LocalUnivariateMinimum parameter range positive and negative problem HOT 1
- ToffoliSimulator outputs different result when executing `Adjoint ApplyAnd`
- An issue about the IncrementByModularInteger function
- DumpMachine state labelling bug when qubits >= 8
- Error using Bound()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quantumlibraries.