docs(quantum-info): add qubit API map - #1501
Conversation
|
Thank you for this pull-request (PR). If this is your first PR, welcome to the community! Below is what will happen next. Please read carefully if you are not familiar with the process. You may open other PRs while this one is being reviewed, and can stack PRs on top of each other, so don't let these steps slow you down.
Tip: The easiest way to get have a fast review is to submit a PR that is small and self-contained, and has clear documentation explaining why things are the way they are in your chages. If you have any problems or questions, please reach out to the community on the Zulip. |
There was a problem hiding this comment.
Could we move this to ./Physlib/QuantumMechanics/Qubit/API-map.yaml, as the long-term plan is to move the QuantumInfo stuff from ./QuantumInfo to ./Physlib eventually.
| done: true | ||
| location: "QuantumInfo/States/Pure/Braket.lean (Ket, Bra, FunLike (Ket d) d ℂ, FunLike (Bra d) d ℂ, Coe (Ket d) (Bra d), Coe (Bra d) (Ket d), FunLike (Bra d) (Ket d) ℂ, dot, Ket.normalized, Ket.basis, uniform_superposition, Braket.dot_self_eq_one)" | ||
|
|
||
| - description: "Density matrices of a finite dimensional system are defined, carrying a coercion to Hermitian matrices and a `Prob` valued inner product of two states, and the API contains expectation values, the spectrum, the maximally mixed state, the embedding of pure states, and the purity together with its characterization of the pure states." |
There was a problem hiding this comment.
Maybe we should split this up a bit, as I think Density matrices should likely sit in another API map
…and split out the finite dimensional mixed-state content
|
Moved to Physlib/QuantumMechanics/Qubit/API-map.yaml, and split the content: the map now keeps the qubit-scoped and pure-state entries only. The density matrix, evolution, measurement and distinguishability entries are gone from it and can get their own map under #848. |
jstoobysmith
left a comment
There was a problem hiding this comment.
Approved - looks good. Will merge shortly
Motivation
Related to #1414, the tracking map for the qubit API in #850. An API map records the implemented status and source location of each requirement for an API, so the gap between a planned API and the current library stays visible in-tree.
Changes
Adds
QuantumInfo/States/Pure/API-map.yaml, 25 requirements of which 11 are done. The done entries coverQubititself, the gatesX,Y,Z,H,SandTwith their relations,controllizeandCNOT, states up to a global phase, POVM measurements, and the fidelity and trace distance, together with the finite dimensional constructions the qubit case instantiates: kets and bras, density matrices, unitary evolution and products. Those last are recorded as the ambient theory rather than as results aboutQubit, since none of them mentions it.Fourteen requirements are recorded as not done. Twelve have nothing behind them in the library yet: the Bloch vector and the Pauli decomposition of a state, the rotation gates and the decomposition of a general single-qubit unitary, the Born rule, the Bell and singlet-triplet bases, a closed form for the fidelity of two qubit states, the positive partial transpose criterion, registers of several qubits with universality of
H,TandCNOT, and the link from kets onQubitto the finite dimensional Hilbert space of a two element target. The other two are the Bloch sphere and the Bargmann invariant. Those are written and proved, inBlochSphere.leanandBargmannInvariant.lean, butQuantumInfo.leanimports neither, so nothing builds them and I did not want to record them as done; you may want to look at that separately from this map.Two things I am unsure about. This is the first API map inside
QuantumInforather than underPhyslib, and the map is titledQubitswhile it sits atQuantumInfo/States/Pure, whose largest module is the generalBraket.lean. Tell me if you would rather it lived underPhyslib/QuantumMechanics, or were split along the lines of #850 and #848.Checks
python3 scripts/api_map_linter.py --repo .passes with no missing files and no missing names, resolving 74 declarations against the Lean sources, and no Lean source is touched.