Add lean source and binary files (part 87)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum.lean +940 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalPathClearance.lean +44 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalPauli.lean +91 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalPenalties.lean +79 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalPropagation.lean +87 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalRealification.lean +86 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalSubdivision.lean +44 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalSupported.lean +41 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalTensor.lean +76 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalThird.lean +46 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalThirdSupported.lean +41 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumManhattanListProgram.lean +43 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumManhattanRoute.lean +130 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumManhattanSupport.lean +61 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMappedGate.lean +49 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMask.lean +65 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMatrixError.lean +53 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMediatorGeometry.lean +36 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMergeEdges.lean +104 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMergedCoefficientBounds.lean +142 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMergedEndpointPairs.lean +55 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMergedOutputRoutes.lean +104 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMergedSupport.lean +168 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumNearestCircuit.lean +66 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumNearestGate.lean +102 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumNearestProgram.lean +128 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOddPathGeometry.lean +67 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOffsetProgram.lean +47 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOffsetSample.lean +104 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOperatorQuadratic.lean +52 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedCellProgram.lean +61 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedCellTable.lean +57 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedCoefficient.lean +199 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedDescriptorProgram.lean +99 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedDescriptors.lean +91 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedFinalBounds.lean +62 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedHistory.lean +67 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedIncidence.lean +180 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelBlocks.lean +176 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelCompile.lean +99 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelCorrectness.lean +89 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelData.lean +107 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelEnergy.lean +84 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelFamily.lean +106 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelOutput.lean +93 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelPacking.lean +106 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelPipeline.lean +61 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelProgram.lean +117 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelSubdivision.lean +94 -0
- lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelTable.lean +103 -0
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum.lean
ADDED
|
@@ -0,0 +1,940 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.ClockPathBound
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.ClockWeightedBound
|
| 3 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAcceptance
|
| 4 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAdjacentCnot
|
| 5 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAdjacentProgram
|
| 6 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAlgebraicHeight
|
| 7 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAlgebraicHistory
|
| 8 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAlgebraicScalar
|
| 9 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAlgebraicScalarProgram
|
| 10 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAnchorDensity
|
| 11 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAncilla
|
| 12 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAncillaCompression
|
| 13 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAncillaCount
|
| 14 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAxisSample
|
| 15 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAxisSampleAccuracy
|
| 16 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAxisSampleProgram
|
| 17 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBitTransfer
|
| 18 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBlockBasis
|
| 19 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBlockBudget
|
| 20 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBlockCoefficientBounds
|
| 21 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBlockEdges
|
| 22 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBlockExchange
|
| 23 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBlockFull
|
| 24 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBlockHamiltonian
|
| 25 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBlockRational
|
| 26 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedArmProgram
|
| 27 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedArms
|
| 28 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedBounds
|
| 29 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedCells
|
| 30 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedCongestion
|
| 31 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedCounts
|
| 32 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedDetour
|
| 33 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedDogleg
|
| 34 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedEndpointWalk
|
| 35 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedExtent
|
| 36 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedFanout
|
| 37 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedGridEdge
|
| 38 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedIntersections
|
| 39 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedLanes
|
| 40 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedListProgram
|
| 41 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedNodes
|
| 42 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedPortChain
|
| 43 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedPortLinks
|
| 44 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedPortRealization
|
| 45 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedProgram
|
| 46 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedRay
|
| 47 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedSharedEdge
|
| 48 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedSourceCells
|
| 49 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumBufferedSupport
|
| 50 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellCatalogProgram
|
| 51 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellCorridor
|
| 52 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellCrossings
|
| 53 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellMatching
|
| 54 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellPassages
|
| 55 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellPathProgram
|
| 56 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellPathTemplates
|
| 57 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellRouteCatalog
|
| 58 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellRouteSupport
|
| 59 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellTranslate
|
| 60 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCellVisitPaths
|
| 61 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumChosenSlots
|
| 62 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCircuitCode
|
| 63 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCircuitPadding
|
| 64 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCircuitPauli
|
| 65 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCircuitPromise
|
| 66 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCircuitTwoLocal
|
| 67 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumClockAnchor
|
| 68 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumClockCells
|
| 69 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumClockPath
|
| 70 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumClockSector
|
| 71 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumClockStep
|
| 72 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumClockTransition
|
| 73 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCoefficientEnvelopeProgram
|
| 74 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCoefficientHeight
|
| 75 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCoefficientPrograms
|
| 76 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCoerciveInverse
|
| 77 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumComputedAccuracy
|
| 78 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumComputedCrossingBounds
|
| 79 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumComputedCrossingRelabel
|
| 80 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumComputedRouteSelector
|
| 81 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumComputedRoutingTable
|
| 82 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCoordinateSpectrum
|
| 83 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCornerPatch
|
| 84 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCorridorEndpoints
|
| 85 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCorridorInterior
|
| 86 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCorridorSeparation
|
| 87 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCountedHistory
|
| 88 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCountertermProgram
|
| 89 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCountertermSample
|
| 90 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingBounds
|
| 91 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingCalibration
|
| 92 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingCoefficientBound
|
| 93 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingCompiled
|
| 94 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingDirections
|
| 95 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingEffective
|
| 96 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingGraph
|
| 97 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingListActual
|
| 98 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingListBlock
|
| 99 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingListFamily
|
| 100 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingListLayer
|
| 101 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingListMatrix
|
| 102 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingListSupport
|
| 103 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingMove
|
| 104 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingOutputRoutes
|
| 105 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPacketBounds
|
| 106 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPacketEnergy
|
| 107 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPairSupport
|
| 108 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingParallel
|
| 109 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPatch
|
| 110 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPatchChart
|
| 111 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPlacement
|
| 112 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPlanarRoutes
|
| 113 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPorts
|
| 114 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPositionProgram
|
| 115 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPositionRelabel
|
| 116 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingRetention
|
| 117 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingScaleProgram
|
| 118 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSelectCorrectness
|
| 119 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSelectFromSites
|
| 120 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSelectProgram
|
| 121 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSelection
|
| 122 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSelectionRelabel
|
| 123 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSelectionUnique
|
| 124 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSiteProgram
|
| 125 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSiteRelabel
|
| 126 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSites
|
| 127 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSize
|
| 128 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSpectrum
|
| 129 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingSupportRelabel
|
| 130 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingsGraph
|
| 131 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDefinedRealization
|
| 132 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDegreeReduction
|
| 133 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDescriptorSiteProgram
|
| 134 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDescriptorSites
|
| 135 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDiagonalTableProgram
|
| 136 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDiagonalTensor
|
| 137 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDistinctCrossings
|
| 138 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDistributedClock
|
| 139 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDistributedFamily
|
| 140 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDistributedGap
|
| 141 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDistributedInput
|
| 142 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDistributedMatrix
|
| 143 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDistributedPositive
|
| 144 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDistributedRebit
|
| 145 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDistributedSpectrum
|
| 146 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumDistributedWitness
|
| 147 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEightBasis
|
| 148 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEndpoint
|
| 149 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEndpointListProgram
|
| 150 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEndpointPorts
|
| 151 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEndpointRelabel
|
| 152 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEntryParity
|
| 153 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvenListPieces
|
| 154 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvenRouteData
|
| 155 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvenRouteLabels
|
| 156 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvenRoutePlacement
|
| 157 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvenRouteRealization
|
| 158 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvenTapeGeometry
|
| 159 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvenTapeOrder
|
| 160 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvenTapeOutputBounds
|
| 161 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvenTapeProgram
|
| 162 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvenTapeWeights
|
| 163 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumEvolution
|
| 164 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumExchangeCrossings
|
| 165 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumExchangeLanes
|
| 166 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumExchangeRounding
|
| 167 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumExchangeRoutes
|
| 168 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumExchangeSample
|
| 169 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumExchangeSampleProgram
|
| 170 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFanoutPaths
|
| 171 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFanoutPorts
|
| 172 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFieldSample
|
| 173 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFinalPrecision
|
| 174 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFinalRoutingProgram
|
| 175 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFineRoute
|
| 176 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFiniteHistory
|
| 177 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFiniteMembership
|
| 178 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFiniteRouteSearch
|
| 179 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFirstUse
|
| 180 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFirstUseProgram
|
| 181 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFirstUseSites
|
| 182 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFixedMatrixProgram
|
| 183 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFixedPauli
|
| 184 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFixedPauliProgram
|
| 185 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkBackground
|
| 186 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkBounds
|
| 187 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkCalibration
|
| 188 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkCells
|
| 189 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkDegreeBound
|
| 190 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkDegrees
|
| 191 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkEffective
|
| 192 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkGraph
|
| 193 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkGridInitial
|
| 194 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkGridProgram
|
| 195 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkInitial
|
| 196 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkInitialCells
|
| 197 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkInitialLocality
|
| 198 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkInitialMatrix
|
| 199 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkInitialSize
|
| 200 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkIteration
|
| 201 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListAccuracy
|
| 202 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListActive
|
| 203 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListBackground
|
| 204 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListBoundProgram
|
| 205 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListCalibration
|
| 206 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListCellIteration
|
| 207 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListCellLocality
|
| 208 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListCellMass
|
| 209 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListCellProgram
|
| 210 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListCells
|
| 211 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListData
|
| 212 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListDegree
|
| 213 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListDegreeIteration
|
| 214 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListEnvelope
|
| 215 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListFinalDegree
|
| 216 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListFullCells
|
| 217 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListFullDegree
|
| 218 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListGraph
|
| 219 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListIndex
|
| 220 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitial
|
| 221 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialAccuracy
|
| 222 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialBounds
|
| 223 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialCalibration
|
| 224 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialCellMass
|
| 225 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialCells
|
| 226 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialDegree
|
| 227 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialMatrix
|
| 228 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialPairs
|
| 229 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialPhysical
|
| 230 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialProgram
|
| 231 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialRealization
|
| 232 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialSpatial
|
| 233 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialStateProgram
|
| 234 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialSum
|
| 235 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListInitialWeights
|
| 236 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListIterateWeights
|
| 237 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListIteration
|
| 238 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListMatrix
|
| 239 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListNext
|
| 240 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListNextBackground
|
| 241 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListNextDegree
|
| 242 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListNextPorts
|
| 243 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListNextValid
|
| 244 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListNextWeights
|
| 245 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListOrdinal
|
| 246 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListOuter
|
| 247 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListOutputBounds
|
| 248 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListPartition
|
| 249 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListPoints
|
| 250 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListProgram
|
| 251 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListRealization
|
| 252 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListRound
|
| 253 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListScale
|
| 254 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListSites
|
| 255 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListSize
|
| 256 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListSpatialPackage
|
| 257 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListSum
|
| 258 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkListWeights
|
| 259 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkLocality
|
| 260 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkParallel
|
| 261 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkPatch
|
| 262 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkPlaced
|
| 263 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkPortSums
|
| 264 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkPorts
|
| 265 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkProgram
|
| 266 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkRounds
|
| 267 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkRoutingData
|
| 268 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkRoutingPaths
|
| 269 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkSpectrum
|
| 270 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkStarGround
|
| 271 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkStarIndex
|
| 272 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkState
|
| 273 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkStateAccuracy
|
| 274 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkStateDegree
|
| 275 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkStateMatrix
|
| 276 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkStateNextMatrix
|
| 277 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumForkWeightBounds
|
| 278 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourAxis
|
| 279 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourBasis
|
| 280 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourCorrelation
|
| 281 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourCorrelationCertificate
|
| 282 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourCounterterm
|
| 283 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourCouplingBounds
|
| 284 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourCouplingScale
|
| 285 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourCross
|
| 286 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourDoubleGap
|
| 287 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourEffective
|
| 288 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourEncoding
|
| 289 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourFields
|
| 290 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourGapCertificate
|
| 291 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourGround
|
| 292 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourIsometry
|
| 293 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourLogical
|
| 294 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourNorm
|
| 295 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourPositive
|
| 296 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourProjector
|
| 297 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourSpatial
|
| 298 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourSpin
|
| 299 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourSpinCertificate
|
| 300 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourSpinTable
|
| 301 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourSpinTransition
|
| 302 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourStencils
|
| 303 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorCoefficientBounds
|
| 304 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorComparison
|
| 305 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorCompression
|
| 306 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorCross
|
| 307 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorEffective
|
| 308 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorEffectiveError
|
| 309 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorError
|
| 310 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorFamily
|
| 311 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorFamilyAccuracy
|
| 312 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorFamilyBounds
|
| 313 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorFields
|
| 314 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorForms
|
| 315 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorFullFamily
|
| 316 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorGap
|
| 317 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorGround
|
| 318 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorHilbert
|
| 319 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorInverse
|
| 320 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorNorm
|
| 321 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorOnsite
|
| 322 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorOperatorBounds
|
| 323 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorOrthogonal
|
| 324 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorScale
|
| 325 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorSpin
|
| 326 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourTensorWeighted
|
| 327 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFourWeighted
|
| 328 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGadgetAlgebra
|
| 329 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGadgetCounterterms
|
| 330 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGateArrival
|
| 331 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGateCode
|
| 332 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGateEntryProgram
|
| 333 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGateLocality
|
| 334 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGateProduct
|
| 335 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGateScalarReduction
|
| 336 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGateUnitary
|
| 337 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGates
|
| 338 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGeometryPowers
|
| 339 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGraphCoefficientBound
|
| 340 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGraphDegree
|
| 341 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridAcceptance
|
| 342 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridCircuit
|
| 343 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridColor
|
| 344 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridCoordinates
|
| 345 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridFrame
|
| 346 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridLocality
|
| 347 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridMidpoint
|
| 348 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridNeighbors
|
| 349 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridNeighborsFour
|
| 350 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridPorts
|
| 351 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridSlots
|
| 352 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridWalk
|
| 353 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGroundComparison
|
| 354 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHalfCorridor
|
| 355 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistory
|
| 356 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryBitProgram
|
| 357 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryCellProgram
|
| 358 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryCells
|
| 359 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryComparison
|
| 360 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryDegree
|
| 361 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryDelta
|
| 362 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryDeltaProgram
|
| 363 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryDescriptorProgram
|
| 364 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryDescriptors
|
| 365 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryDiagonal
|
| 366 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryDiagonalProgram
|
| 367 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryEnergy
|
| 368 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryEnumeration
|
| 369 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryFork
|
| 370 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryHeight
|
| 371 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryIncidence
|
| 372 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryLattice
|
| 373 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryLiteralCorrectness
|
| 374 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryLiteralPromise
|
| 375 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryMatrix
|
| 376 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryMatrixForm
|
| 377 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryOutputBounds
|
| 378 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryParameterBounds
|
| 379 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryPrecisionProgram
|
| 380 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryPreparedProgram
|
| 381 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryRawCells
|
| 382 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryRoutedEnergy
|
| 383 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryRoutingProgram
|
| 384 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistorySamplerProgram
|
| 385 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistorySampling
|
| 386 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistorySiteProgram
|
| 387 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistorySizeBounds
|
| 388 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistorySourcePowers
|
| 389 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistorySourceProgram
|
| 390 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistorySourcePromise
|
| 391 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistorySpatial
|
| 392 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistorySpatialProgram
|
| 393 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistorySpectrum
|
| 394 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryTableCorrectness
|
| 395 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryTableProgram
|
| 396 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryThreeLocal
|
| 397 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryThreeLocalEnergy
|
| 398 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryWitness
|
| 399 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryXZ
|
| 400 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryXZBounds
|
| 401 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryXZPromise
|
| 402 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumInflatedListProgram
|
| 403 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumInflatedPath
|
| 404 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumInflatedSeparation
|
| 405 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumInnerPorts
|
| 406 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumInputProjection
|
| 407 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumInternalHalfSeparation
|
| 408 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumInternalRouteSeparation
|
| 409 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLaneSupport
|
| 410 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLaneUnaryProgram
|
| 411 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLatticeCoefficient
|
| 412 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLatticeEncoding
|
| 413 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLatticeEnvelope
|
| 414 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLatticePromise
|
| 415 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLatticeSerialization
|
| 416 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLatticeSource
|
| 417 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLatticeSourceBounds
|
| 418 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListGraph
|
| 419 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListLattice
|
| 420 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListLatticeProgram
|
| 421 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListMerge
|
| 422 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListMergeMatrix
|
| 423 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListMergeProgram
|
| 424 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListMergeProperties
|
| 425 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListPathAccuracy
|
| 426 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListPathInput
|
| 427 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListPathMatrix
|
| 428 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListPathProgram
|
| 429 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListPathStep
|
| 430 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRouteLattice
|
| 431 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRouteMatching
|
| 432 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRouteNextPoint
|
| 433 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRouteNextPosition
|
| 434 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRouteNextWork
|
| 435 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRouteOutputBounds
|
| 436 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRouteOutputProgram
|
| 437 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRoutePathOrder
|
| 438 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRoutePieces
|
| 439 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRoutePreservation
|
| 440 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRouteProgram
|
| 441 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRouteRepresentation
|
| 442 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListRouteSelection
|
| 443 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListSchedule
|
| 444 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListScheduleBounds
|
| 445 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListScheduleGeometry
|
| 446 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListScheduleGraph
|
| 447 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListScheduleLabels
|
| 448 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListScheduleOrder
|
| 449 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListScheduleProgram
|
| 450 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListScheduleRealization
|
| 451 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListScheduleRelabel
|
| 452 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListScheduleScale
|
| 453 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListScheduleWeights
|
| 454 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalAction
|
| 455 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalCoordinates
|
| 456 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalCore
|
| 457 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalDecomposition
|
| 458 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalEnlarge
|
| 459 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalError
|
| 460 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalFamily
|
| 461 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalInput
|
| 462 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalJoin
|
| 463 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalLift
|
| 464 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalModel
|
| 465 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalPathClearance
|
| 466 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalPauli
|
| 467 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalPenalties
|
| 468 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalPropagation
|
| 469 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalRealification
|
| 470 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalSubdivision
|
| 471 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalSupported
|
| 472 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalTensor
|
| 473 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalThird
|
| 474 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalThirdSupported
|
| 475 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumManhattanListProgram
|
| 476 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumManhattanRoute
|
| 477 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumManhattanSupport
|
| 478 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMappedGate
|
| 479 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMask
|
| 480 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMatrixError
|
| 481 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMediatorGeometry
|
| 482 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMergeEdges
|
| 483 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMergedCoefficientBounds
|
| 484 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMergedEndpointPairs
|
| 485 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMergedOutputRoutes
|
| 486 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMergedSupport
|
| 487 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumNearestCircuit
|
| 488 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumNearestGate
|
| 489 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumNearestProgram
|
| 490 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOddPathGeometry
|
| 491 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOffsetProgram
|
| 492 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOffsetSample
|
| 493 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOperatorQuadratic
|
| 494 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedCellProgram
|
| 495 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedCellTable
|
| 496 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedCoefficient
|
| 497 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedDescriptorProgram
|
| 498 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedDescriptors
|
| 499 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedFinalBounds
|
| 500 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedHistory
|
| 501 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedIncidence
|
| 502 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelBlocks
|
| 503 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelCompile
|
| 504 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelCorrectness
|
| 505 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelData
|
| 506 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelEnergy
|
| 507 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelFamily
|
| 508 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelOutput
|
| 509 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelPacking
|
| 510 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelPipeline
|
| 511 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelProgram
|
| 512 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelSubdivision
|
| 513 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelTable
|
| 514 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelThird
|
| 515 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelYY
|
| 516 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedModel
|
| 517 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedOutputBounds
|
| 518 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedOutputSpatial
|
| 519 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedPrivate
|
| 520 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedPrivateSpatial
|
| 521 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedRawBlock
|
| 522 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedRawCells
|
| 523 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedRawPacking
|
| 524 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedRawPackingProgram
|
| 525 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedReference
|
| 526 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedSampling
|
| 527 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedSourceIndex
|
| 528 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedSpatial
|
| 529 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedSpatialComplete
|
| 530 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedSpatialSites
|
| 531 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedSplit
|
| 532 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedSubdivision
|
| 533 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedSupport
|
| 534 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedTable
|
| 535 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedThird
|
| 536 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedThirdSites
|
| 537 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedThirdXZ
|
| 538 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedTriple
|
| 539 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedTripleFactors
|
| 540 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedTwoStage
|
| 541 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedWeightBounds
|
| 542 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedWeightProgram
|
| 543 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedXZEnergy
|
| 544 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedXZPipeline
|
| 545 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedXZTerm
|
| 546 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedYYFactors
|
| 547 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedYYReduction
|
| 548 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrdinalPlacement
|
| 549 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrdinalProgram
|
| 550 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrdinalSlots
|
| 551 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrdinalSpatial
|
| 552 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPackedSchedule
|
| 553 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPacketGeometry
|
| 554 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPacketRoutingGeometry
|
| 555 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedBasis
|
| 556 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedEvolution
|
| 557 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedGate
|
| 558 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedHistory
|
| 559 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedInput
|
| 560 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedLabelData
|
| 561 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedLabelEnergy
|
| 562 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedLabelMeaning
|
| 563 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedLabelProgram
|
| 564 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedLabelTable
|
| 565 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedLocal
|
| 566 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedPacketProgram
|
| 567 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedPauli
|
| 568 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedSampling
|
| 569 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPaddedTableProgram
|
| 570 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPairDedup
|
| 571 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumParallelGraph
|
| 572 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumParallelRouteSearch
|
| 573 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPartialPaths
|
| 574 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPatchEdgeCover
|
| 575 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPatchPhysical
|
| 576 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPatchPoints
|
| 577 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPatchSeparation
|
| 578 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathCoverage
|
| 579 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathCoverageReverse
|
| 580 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathDegrees
|
| 581 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathEmbedding
|
| 582 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathIteratedBound
|
| 583 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathPatch
|
| 584 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathPieces
|
| 585 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathPlacement
|
| 586 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathPolynomialBound
|
| 587 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathProgram
|
| 588 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathRelabeling
|
| 589 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathRelabelingIteration
|
| 590 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathRelabelingNext
|
| 591 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathRelabelingProperties
|
| 592 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathScaleProgram
|
| 593 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathSchedule
|
| 594 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathScheduleSize
|
| 595 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathSpectrum
|
| 596 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathSubdivision
|
| 597 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathTable
|
| 598 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathVisitCorrectness
|
| 599 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathVisitProgram
|
| 600 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathWeightBounds
|
| 601 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathsCalibration
|
| 602 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathsGraph
|
| 603 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPathsParallel
|
| 604 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliAlgebra
|
| 605 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliBasis
|
| 606 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliCongestion
|
| 607 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliExpansion
|
| 608 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliExtend
|
| 609 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliLocal
|
| 610 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliMonomial
|
| 611 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliParity
|
| 612 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliProduct
|
| 613 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliReal
|
| 614 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliRounding
|
| 615 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliSingle
|
| 616 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliSplit
|
| 617 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliSubdivision
|
| 618 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliThird
|
| 619 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliTripleSplit
|
| 620 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPermittedEndpointAvoidance
|
| 621 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPermittedRouteSeparation
|
| 622 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPhysicalCells
|
| 623 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPhysicalEndpointCover
|
| 624 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPinnedClock
|
| 625 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPlanarDegree
|
| 626 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPlanarListData
|
| 627 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPlanarRelabel
|
| 628 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPlanarRouteData
|
| 629 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPlanarRouteRealization
|
| 630 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPlanarSelectorTransport
|
| 631 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPlanarTapeGeometry
|
| 632 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPlanarTapeProgram
|
| 633 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPlanarTapeSupport
|
| 634 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPolarizedSubdivision
|
| 635 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPolarizedThird
|
| 636 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPolynomialUnary
|
| 637 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortCellPositive
|
| 638 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortChain
|
| 639 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortChainActual
|
| 640 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortChainBounds
|
| 641 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortChainProgram
|
| 642 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortChainSeparation
|
| 643 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortCrossingSelection
|
| 644 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortGraphPairs
|
| 645 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortInnerPair
|
| 646 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortLinks
|
| 647 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortPairing
|
| 648 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortPlanarRealization
|
| 649 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortRank
|
| 650 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortRankActual
|
| 651 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortRankProgram
|
| 652 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortRaySupport
|
| 653 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortRouteData
|
| 654 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortScheduleActual
|
| 655 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortSchedulePacking
|
| 656 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortScheduleTape
|
| 657 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortSelectionProgram
|
| 658 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPortSpinCoverage
|
| 659 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPrefix
|
| 660 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPreparedCircuit
|
| 661 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPreparedLattice
|
| 662 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPreparedVerifier
|
| 663 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPrivateAccuracy
|
| 664 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPrivateCompiler
|
| 665 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPrivateFamily
|
| 666 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPrivateList
|
| 667 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPrivateProgram
|
| 668 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPrivateRaw
|
| 669 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPrivateSupported
|
| 670 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPrivateTerms
|
| 671 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPromisePowers
|
| 672 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPropagationAction
|
| 673 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPropagationOrder
|
| 674 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPropagationSampler
|
| 675 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPropagationSupport
|
| 676 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPropagationTable
|
| 677 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumQuadratic
|
| 678 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumQuadraticReindex
|
| 679 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRationalCrossing
|
| 680 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRationalDegreeReduction
|
| 681 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRationalFork
|
| 682 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRationalPathStep
|
| 683 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRationalSpatialPackage
|
| 684 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawCellDensity
|
| 685 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawCellLocality
|
| 686 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawCoefficientBounds
|
| 687 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawCompiler
|
| 688 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawCorrectness
|
| 689 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawEnvelope
|
| 690 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawExchange
|
| 691 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawFamilyCorrectness
|
| 692 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawFamilyProgram
|
| 693 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawIncidence
|
| 694 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawOutputBounds
|
| 695 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawOutputSize
|
| 696 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawProgram
|
| 697 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawSchedule
|
| 698 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawTermProgram
|
| 699 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRealCircuit
|
| 700 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRealLocalFamily
|
| 701 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRealification
|
| 702 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRebitDiagonal
|
| 703 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRebitLocal
|
| 704 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRebitSoundness
|
| 705 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRectangularOperator
|
| 706 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceBasis
|
| 707 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceBlocks
|
| 708 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceComparison
|
| 709 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceCongestion
|
| 710 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceEdgeTable
|
| 711 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceEdges
|
| 712 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceFamily
|
| 713 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceHistory
|
| 714 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceLocal
|
| 715 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceLower
|
| 716 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceModel
|
| 717 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferencePenalty
|
| 718 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceReal
|
| 719 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceTensor
|
| 720 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceTerms
|
| 721 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumReferenceWalls
|
| 722 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRetainedCrossing
|
| 723 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRetainedGeometry
|
| 724 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRetainedRoutes
|
| 725 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRetainedSupport
|
| 726 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteCandidates
|
| 727 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteCongestion
|
| 728 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteEnumeration
|
| 729 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteLanes
|
| 730 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteLeaf
|
| 731 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteLeafProgram
|
| 732 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutePermissionCongr
|
| 733 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteProgram
|
| 734 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteSelectorCorrectness
|
| 735 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteSelectorProgram
|
| 736 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutedSubdivision
|
| 737 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingBlocks
|
| 738 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingCrossingTest
|
| 739 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingFamily
|
| 740 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingForms
|
| 741 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingGraph
|
| 742 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingInputActual
|
| 743 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingInputProgram
|
| 744 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingPhysical
|
| 745 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingProgram
|
| 746 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingScale
|
| 747 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingSize
|
| 748 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingSpectrum
|
| 749 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingTable
|
| 750 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingTableCorrectness
|
| 751 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRowInsertion
|
| 752 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRowOrder
|
| 753 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRowStageBounds
|
| 754 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRowStageSupport
|
| 755 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRowTransfer
|
| 756 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSampleAssembly
|
| 757 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSampleBudget
|
| 758 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSamplePrecision
|
| 759 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumScalarFaithful
|
| 760 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumScalarReindex
|
| 761 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumScaledDirection
|
| 762 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumScaledEdge
|
| 763 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumScheduleCrossingGeometry
|
| 764 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSelectedRoute
|
| 765 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSingletStar
|
| 766 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSingletStarBounds
|
| 767 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSingletStarSpectrum
|
| 768 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSortedTime
|
| 769 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSoundness
|
| 770 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpacedListProgram
|
| 771 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSparseEndpoint
|
| 772 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSparseFirstUse
|
| 773 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialCircuit
|
| 774 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialClockTerms
|
| 775 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialCrossingGeometry
|
| 776 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialCrossingProgram
|
| 777 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialCrossingSupport
|
| 778 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialDegreeReduction
|
| 779 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialDegreeThree
|
| 780 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialExchange
|
| 781 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialExchangeCircuit
|
| 782 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialExchangeModel
|
| 783 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialFinalCount
|
| 784 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialFinalEnergy
|
| 785 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialFinalGeometry
|
| 786 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialGadgets
|
| 787 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialInput
|
| 788 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialInputBounds
|
| 789 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialInputTape
|
| 790 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialLattice
|
| 791 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialModel
|
| 792 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialOccupancy
|
| 793 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialPlaced
|
| 794 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialPlanarBounds
|
| 795 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialPlanarRealization
|
| 796 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialPortBounds
|
| 797 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialPortMatching
|
| 798 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialPortProgram
|
| 799 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialPrivate
|
| 800 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialPropagation
|
| 801 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialRational
|
| 802 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialReference
|
| 803 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialReindex
|
| 804 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialRoutingTape
|
| 805 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialSlotProgram
|
| 806 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialSourcePromise
|
| 807 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialSubdivision
|
| 808 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialTerms
|
| 809 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialThird
|
| 810 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialTotal
|
| 811 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialXZ
|
| 812 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialXZBounds
|
| 813 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpecifiedLattice
|
| 814 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumStageIndex
|
| 815 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumStagePath
|
| 816 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumStageStep
|
| 817 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSubdivisionSites
|
| 818 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSupportDedup
|
| 819 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSupportLookup
|
| 820 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSupportedSubdivision
|
| 821 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSupportedThird
|
| 822 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSwapConjugation
|
| 823 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSweepCellProgram
|
| 824 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSweepCells
|
| 825 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSweepCircuit
|
| 826 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSweepCongestion
|
| 827 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSweepCoverage
|
| 828 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSweepCursor
|
| 829 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSweepEndpoint
|
| 830 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSweepIndex
|
| 831 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSweepListProgram
|
| 832 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSweepProgram
|
| 833 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTaggedRouteProgram
|
| 834 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTaggedStage
|
| 835 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTaggedSupport
|
| 836 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTaggedSweep
|
| 837 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTaggedTransfer
|
| 838 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTensorAction
|
| 839 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTensorMatrix
|
| 840 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTensorPair
|
| 841 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTensorPairLinear
|
| 842 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTensorSucc
|
| 843 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTermTime
|
| 844 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumThirdCounterterm
|
| 845 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTimeCongestion
|
| 846 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTimeGrouping
|
| 847 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTransferGate
|
| 848 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTransferIndex
|
| 849 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTransferSweep
|
| 850 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTranslatedInternalSeparation
|
| 851 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTranslatedPatch
|
| 852 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumTripleSupported
|
| 853 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryClock
|
| 854 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryEmbedding
|
| 855 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryEmbeddingEnergy
|
| 856 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryEnergy
|
| 857 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryForm
|
| 858 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryMatrix
|
| 859 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryPenalty
|
| 860 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryPrefix
|
| 861 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryPrefixCertificate
|
| 862 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryPrefixRun
|
| 863 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnaryPrefixTransfers
|
| 864 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnarySoundness
|
| 865 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnarySpectrum
|
| 866 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUnitaryGround
|
| 867 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumUntouchedInput
|
| 868 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumVerifier
|
| 869 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWalkErasure
|
| 870 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWalkErasureProgram
|
| 871 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWalkSeek
|
| 872 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWalkSupport
|
| 873 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWireGrid
|
| 874 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWireIntertwining
|
| 875 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWireRelabel
|
| 876 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWireRouting
|
| 877 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWireState
|
| 878 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWireSwap
|
| 879 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZEnvelopes
|
| 880 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZFamily
|
| 881 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZFamilySplit
|
| 882 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZHeisenberg
|
| 883 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZModel
|
| 884 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZPrivate
|
| 885 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZReduction
|
| 886 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZSample
|
| 887 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZScalarSample
|
| 888 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZSubdivision
|
| 889 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZSupportFactors
|
| 890 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZSupported
|
| 891 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZTerms
|
| 892 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZThird
|
| 893 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZThirdSupported
|
| 894 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumXZTriple
|
| 895 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumYYElimination
|
| 896 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumYYFactor
|
| 897 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumYYReduction
|
| 898 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumYYSupported
|
| 899 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorAncilla
|
| 900 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorBounds
|
| 901 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorForms
|
| 902 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorGround
|
| 903 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorHilbert
|
| 904 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorMatrix
|
| 905 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorNorm
|
| 906 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorNormBounds
|
| 907 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorPenalty
|
| 908 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorPhysical
|
| 909 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorProjection
|
| 910 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorSeriesError
|
| 911 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorSeriesMatrix
|
| 912 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorTargetGround
|
| 913 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorThirdForm
|
| 914 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitMediatorTrial
|
| 915 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitPhase
|
| 916 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitPhaseLocal
|
| 917 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitPhasePhysical
|
| 918 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitPhysicalComparison
|
| 919 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionCalibration
|
| 920 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionDecomposition
|
| 921 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionEnvelope
|
| 922 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionGadget
|
| 923 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionGround
|
| 924 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionHermitian
|
| 925 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionLocalFamily
|
| 926 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionMatrix
|
| 927 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionNorm
|
| 928 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionReal
|
| 929 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitSubdivisionScale
|
| 930 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdCalibration
|
| 931 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdDecomposition
|
| 932 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdEnvelope
|
| 933 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdFamilyBounds
|
| 934 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdGadget
|
| 935 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdHermitian
|
| 936 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdLocalFamily
|
| 937 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdLocality
|
| 938 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdNormBudget
|
| 939 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdPhased
|
| 940 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QubitThirdPhasedLocal
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalPathClearance.lean
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHalfCorridor
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Exact endpoint clearance inside one cell. These finite facts separate
|
| 6 |
+
external corridors from the rays, ordinary pairs and nine gadget paths. -/
|
| 7 |
+
|
| 8 |
+
namespace ContinuumCoulomb
|
| 9 |
+
|
| 10 |
+
def qmaLocalPhysicalSites (cross : Bool) : Finset (ℕ × ℕ) :=
|
| 11 |
+
if cross then {(16,16),(10,16),(16,22),(22,16),(16,10),(14,18),(18,14)}
|
| 12 |
+
else {(16,16),(23,16),(16,23),(9,16),(16,9)}
|
| 13 |
+
|
| 14 |
+
theorem qmaHalfCorridor_sites (cross : Bool) (a : Fin 4) :
|
| 15 |
+
Disjoint ((qmaHalfCorridorPath cross a).drop 1).toFinset (qmaLocalPhysicalSites cross) := by
|
| 16 |
+
cases cross <;> fin_cases a <;> decide
|
| 17 |
+
|
| 18 |
+
theorem qmaCellRay_sites (a : Fin 4) :
|
| 19 |
+
Disjoint (((qmaCellRayPath a).drop 1).dropLast).toFinset (qmaLocalPhysicalSites false) := by
|
| 20 |
+
fin_cases a <;> decide
|
| 21 |
+
|
| 22 |
+
theorem qmaLocalPatch_sites (e : Fin 9) :
|
| 23 |
+
Disjoint (((qmaLocalPatchPath e).drop 1).dropLast).toFinset (qmaLocalPhysicalSites true) := by
|
| 24 |
+
fin_cases e <;> decide
|
| 25 |
+
|
| 26 |
+
theorem qmaCellPair_half (e : Fin 6) (a : Fin 4) :
|
| 27 |
+
Disjoint (((qmaCellPairPath e).drop 1).dropLast).toFinset (qmaHalfCorridorPath false a).toFinset := by
|
| 28 |
+
fin_cases e <;> fin_cases a <;> decide
|
| 29 |
+
|
| 30 |
+
theorem qmaCellRay_half (e a : Fin 4) :
|
| 31 |
+
Disjoint (((qmaCellRayPath e).drop 1).dropLast).toFinset (qmaHalfCorridorPath false a).toFinset := by
|
| 32 |
+
fin_cases e <;> fin_cases a <;> decide
|
| 33 |
+
|
| 34 |
+
theorem qmaLocalPatch_half (e : Fin 9) (a : Fin 4) :
|
| 35 |
+
Disjoint (((qmaLocalPatchPath e).drop 1).dropLast).toFinset (qmaHalfCorridorPath true a).toFinset := by
|
| 36 |
+
fin_cases e <;> fin_cases a <;> decide
|
| 37 |
+
|
| 38 |
+
theorem qmaLocalPatch_bounded (e : Fin 9) :
|
| 39 |
+
∀ p ∈ qmaLocalPatchPath e, 10 ≤ p.1 ∧ p.1 ≤ 22 ∧ 10 ≤ p.2 ∧ p.2 ≤ 22 := by
|
| 40 |
+
fin_cases e <;> decide
|
| 41 |
+
|
| 42 |
+
end ContinuumCoulomb
|
| 43 |
+
|
| 44 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalPauli.lean
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliExtend
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! A bounded-support real family expands into only even-Y Pauli words. -/
|
| 6 |
+
|
| 7 |
+
noncomputable section
|
| 8 |
+
namespace ContinuumCoulomb
|
| 9 |
+
open Matrix
|
| 10 |
+
open scoped BigOperators Classical
|
| 11 |
+
variable {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α]
|
| 12 |
+
|
| 13 |
+
abbrev QMALocalPauliTerm (S : α → Finset ι) :=
|
| 14 |
+
(a : α) × ({i // i ∈ S a} → Fin 4)
|
| 15 |
+
|
| 16 |
+
abbrev QMALocalEvenPauliTerm (S : α → Finset ι) :=
|
| 17 |
+
{p : QMALocalPauliTerm S // Even (qmaPauliYCount p.2)}
|
| 18 |
+
|
| 19 |
+
def qmaLocalPauliWord (S : α → Finset ι) (p : QMALocalPauliTerm S) : ι → Fin 4 :=
|
| 20 |
+
qmaPauliExtend (S p.1) p.2
|
| 21 |
+
|
| 22 |
+
def qmaLocalPauliCoefficient (F : α → Matrix (ι → Fin 2) (ι → Fin 2) ℂ)
|
| 23 |
+
(S : α → Finset ι) (p : QMALocalPauliTerm S) : ℝ :=
|
| 24 |
+
(qmaPauliCoefficient (qmaLocalCore (S p.1) (F p.1)) p.2).re
|
| 25 |
+
|
| 26 |
+
def qmaLocalPauliMatrix (F : α → Matrix (ι → Fin 2) (ι → Fin 2) ℂ)
|
| 27 |
+
(S : α → Finset ι) (p : QMALocalPauliTerm S) : Matrix (ι → Fin 2) (ι → Fin 2) ℂ :=
|
| 28 |
+
(qmaLocalPauliCoefficient F S p : ℂ) • qmaPauliWord (qmaLocalPauliWord S p)
|
| 29 |
+
|
| 30 |
+
theorem qmaLocalPauli_sum (F : α → Matrix (ι → Fin 2) (ι → Fin 2) ℂ)
|
| 31 |
+
(S : α → Finset ι) (hF : ∀ a, QMALocalOn (S a) (F a)) (hH : ∀ a, (F a).IsHermitian) :
|
| 32 |
+
(∑ p : QMALocalPauliTerm S, qmaLocalPauliMatrix F S p) = ∑ a, F a := by
|
| 33 |
+
rw [Fintype.sum_sigma]
|
| 34 |
+
apply Finset.sum_congr rfl
|
| 35 |
+
intro a _
|
| 36 |
+
simp only [qmaLocalPauliMatrix,qmaLocalPauliWord,qmaPauliExtend_lift]
|
| 37 |
+
exact (hF a).pauli_expansion (hH a)
|
| 38 |
+
|
| 39 |
+
omit [Fintype α] in
|
| 40 |
+
theorem qmaLocalPauli_odd_zero (F : α → Matrix (ι → Fin 2) (ι → Fin 2) ℂ)
|
| 41 |
+
(S : α → Finset ι) (hH : ∀ a, (F a).IsHermitian)
|
| 42 |
+
(hR : ∀ a, QMAEntryParity false (F a)) (p : QMALocalPauliTerm S)
|
| 43 |
+
(hp : Odd (qmaPauliYCount p.2)) : qmaLocalPauliMatrix F S p = 0 := by
|
| 44 |
+
have he := qmaPauliCoefficient_odd_zero (qmaLocalCore (S p.1) (F p.1))
|
| 45 |
+
(qmaLocalCore_hermitian _ _ (hH p.1)) (qmaLocalCore_real _ _ (hR p.1)) p.2 hp
|
| 46 |
+
simp only [qmaLocalPauliMatrix,qmaLocalPauliCoefficient,he,Complex.zero_re,
|
| 47 |
+
Complex.ofReal_zero,zero_smul]
|
| 48 |
+
|
| 49 |
+
theorem qmaLocalEvenPauli_sum (F : α → Matrix (ι → Fin 2) (ι → Fin 2) ℂ)
|
| 50 |
+
(S : α → Finset ι) (hF : ∀ a, QMALocalOn (S a) (F a)) (hH : ∀ a, (F a).IsHermitian)
|
| 51 |
+
(hR : ∀ a, QMAEntryParity false (F a)) :
|
| 52 |
+
(∑ p : QMALocalEvenPauliTerm S, qmaLocalPauliMatrix F S p.val) = ∑ a, F a := by
|
| 53 |
+
rw [← qmaLocalPauli_sum F S hF hH]
|
| 54 |
+
let T : Finset (QMALocalPauliTerm S) := Finset.univ.filter (fun p => Even (qmaPauliYCount p.2))
|
| 55 |
+
have hsub := Finset.sum_subtype (F := inferInstance) T
|
| 56 |
+
(by simp [T] : ∀ p, p ∈ T ↔ Even (qmaPauliYCount p.2)) (qmaLocalPauliMatrix F S)
|
| 57 |
+
rw [← hsub]
|
| 58 |
+
apply Finset.sum_subset (Finset.subset_univ T)
|
| 59 |
+
intro p _ hp
|
| 60 |
+
have hn : ¬Even (qmaPauliYCount p.2) := by simpa [T] using hp
|
| 61 |
+
exact qmaLocalPauli_odd_zero F S hH hR p ((Nat.even_or_odd _).resolve_left hn)
|
| 62 |
+
|
| 63 |
+
omit [Fintype ι] in
|
| 64 |
+
theorem qmaLocalEvenPauli_count (S : α → Finset ι) {d : ℕ} (hS : ∀ a, (S a).card ≤ d) :
|
| 65 |
+
Fintype.card (QMALocalEvenPauliTerm S) ≤ 4^d*Fintype.card α := by
|
| 66 |
+
apply (Fintype.card_subtype_le _).trans
|
| 67 |
+
calc
|
| 68 |
+
Fintype.card (QMALocalPauliTerm S) = ∑ a : α, 4^(S a).card := by
|
| 69 |
+
simp only [QMALocalPauliTerm,Fintype.card_sigma,Fintype.card_fun,Fintype.card_fin,
|
| 70 |
+
Fintype.card_coe]
|
| 71 |
+
_ ≤ ∑ _a : α, 4^d := Finset.sum_le_sum (fun a _ =>
|
| 72 |
+
pow_le_pow_right₀ (by norm_num : (1:ℕ) ≤ 4) (hS a))
|
| 73 |
+
_ = _ := by simp [Nat.mul_comm]
|
| 74 |
+
|
| 75 |
+
omit [Fintype α] in
|
| 76 |
+
theorem qmaLocalEvenPauli_support (S : α → Finset ι) {d : ℕ}
|
| 77 |
+
(hS : ∀ a, (S a).card ≤ d) (p : QMALocalEvenPauliTerm S) :
|
| 78 |
+
(qmaPauliSupport (qmaLocalPauliWord S p.val)).card ≤ d :=
|
| 79 |
+
(Finset.card_le_card (qmaPauliExtend_support _ _)).trans (hS p.val.1)
|
| 80 |
+
|
| 81 |
+
omit [Fintype α] in
|
| 82 |
+
theorem qmaLocalEvenPauli_even (S : α → Finset ι) (p : QMALocalEvenPauliTerm S) :
|
| 83 |
+
Even (qmaPauliYCount (qmaLocalPauliWord S p.val)) := by
|
| 84 |
+
rw [qmaLocalPauliWord,qmaPauliExtend_yCount]
|
| 85 |
+
exact p.property
|
| 86 |
+
|
| 87 |
+
end ContinuumCoulomb
|
| 88 |
+
|
| 89 |
+
end
|
| 90 |
+
|
| 91 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalPenalties.lean
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalPropagation
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! The clock and endpoint penalties are explicit one- and two-qubit terms. -/
|
| 6 |
+
|
| 7 |
+
noncomputable section
|
| 8 |
+
namespace ContinuumCoulomb
|
| 9 |
+
open Matrix
|
| 10 |
+
open scoped BigOperators Classical
|
| 11 |
+
|
| 12 |
+
variable {ι : Type*} [Fintype ι] [DecidableEq ι]
|
| 13 |
+
|
| 14 |
+
def qmaBitDiagonal (i : ι) (f : Fin 2 → ℂ) : Matrix (ι → Fin 2) (ι → Fin 2) ℂ :=
|
| 15 |
+
Matrix.diagonal (fun s => f (s i))
|
| 16 |
+
|
| 17 |
+
def qmaPairDiagonal (i j : ι) (f : Fin 2 → Fin 2 → ℂ) :
|
| 18 |
+
Matrix (ι → Fin 2) (ι → Fin 2) ℂ :=
|
| 19 |
+
Matrix.diagonal (fun s => f (s i) (s j))
|
| 20 |
+
|
| 21 |
+
theorem qmaBitDiagonal_local (i : ι) (f : Fin 2 → ℂ) :
|
| 22 |
+
QMALocalOn {i} (qmaBitDiagonal i f) := by
|
| 23 |
+
apply qmaLocalOn_diagonal
|
| 24 |
+
intro s t h
|
| 25 |
+
rw [h i (by simp)]
|
| 26 |
+
|
| 27 |
+
theorem qmaPairDiagonal_local (i j : ι) (f : Fin 2 → Fin 2 → ℂ) :
|
| 28 |
+
QMALocalOn {i,j} (qmaPairDiagonal i j f) := by
|
| 29 |
+
apply qmaLocalOn_diagonal
|
| 30 |
+
intro s t h
|
| 31 |
+
rw [h i (by simp),h j (by simp)]
|
| 32 |
+
|
| 33 |
+
def qmaClockFaultTerm (c : QMACircuit) (i : Fin (c.gates.length+1)) :
|
| 34 |
+
Matrix (QMACircuitQubit c → Fin 2) (QMACircuitQubit c → Fin 2) ℂ :=
|
| 35 |
+
qmaPairDiagonal (Sum.inl i.castSucc) (Sum.inl i.succ)
|
| 36 |
+
(fun a b => if a = 0 ∧ b = 1 then 1 else 0)
|
| 37 |
+
|
| 38 |
+
def qmaClockLeftTerm (c : QMACircuit) :
|
| 39 |
+
Matrix (QMACircuitQubit c → Fin 2) (QMACircuitQubit c → Fin 2) ℂ :=
|
| 40 |
+
qmaBitDiagonal (Sum.inl 0) (fun a => if a = 1 then 0 else 1)
|
| 41 |
+
|
| 42 |
+
def qmaClockRightTerm (c : QMACircuit) :
|
| 43 |
+
Matrix (QMACircuitQubit c → Fin 2) (QMACircuitQubit c → Fin 2) ℂ :=
|
| 44 |
+
qmaBitDiagonal (Sum.inl (Fin.last (c.gates.length+1))) (fun a => if a = 0 then 0 else 1)
|
| 45 |
+
|
| 46 |
+
def qmaInputTerm (c : QMACircuit) (i : Fin (c.work+1)) :
|
| 47 |
+
Matrix (QMACircuitQubit c → Fin 2) (QMACircuitQubit c → Fin 2) ℂ :=
|
| 48 |
+
qmaPairDiagonal (Sum.inl (qmaInputMarker c)) (Sum.inr i)
|
| 49 |
+
(fun a b => if a = 0 then if c.witness ≤ i.val ∧ b ≠ 0 then 7 else 0 else 0)
|
| 50 |
+
|
| 51 |
+
def qmaOutputTerm (c : QMACircuit) :
|
| 52 |
+
Matrix (QMACircuitQubit c → Fin 2) (QMACircuitQubit c → Fin 2) ℂ :=
|
| 53 |
+
qmaPairDiagonal (Sum.inl (qmaOutputMarker c)) (Sum.inr (Fin.last c.work))
|
| 54 |
+
(fun a b => if a = 1 ∧ b ≠ 1 then 1 else 0)
|
| 55 |
+
|
| 56 |
+
theorem qmaClockFaultTerm_local (c : QMACircuit) (i : Fin (c.gates.length+1)) :
|
| 57 |
+
QMALocalOn {Sum.inl i.castSucc,Sum.inl i.succ} (qmaClockFaultTerm c i) :=
|
| 58 |
+
qmaPairDiagonal_local _ _ _
|
| 59 |
+
|
| 60 |
+
theorem qmaClockLeftTerm_local (c : QMACircuit) :
|
| 61 |
+
QMALocalOn {Sum.inl 0} (qmaClockLeftTerm c) := qmaBitDiagonal_local _ _
|
| 62 |
+
|
| 63 |
+
theorem qmaClockRightTerm_local (c : QMACircuit) :
|
| 64 |
+
QMALocalOn {Sum.inl (Fin.last (c.gates.length+1))} (qmaClockRightTerm c) :=
|
| 65 |
+
qmaBitDiagonal_local _ _
|
| 66 |
+
|
| 67 |
+
theorem qmaInputTerm_local (c : QMACircuit) (i : Fin (c.work+1)) :
|
| 68 |
+
QMALocalOn {Sum.inl (qmaInputMarker c),Sum.inr i} (qmaInputTerm c i) :=
|
| 69 |
+
qmaPairDiagonal_local _ _ _
|
| 70 |
+
|
| 71 |
+
theorem qmaOutputTerm_local (c : QMACircuit) :
|
| 72 |
+
QMALocalOn {Sum.inl (qmaOutputMarker c),Sum.inr (Fin.last c.work)} (qmaOutputTerm c) :=
|
| 73 |
+
qmaPairDiagonal_local _ _ _
|
| 74 |
+
|
| 75 |
+
end ContinuumCoulomb
|
| 76 |
+
|
| 77 |
+
end
|
| 78 |
+
|
| 79 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalPropagation.lean
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalAction
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Every guarded propagation term acts on three clock bits and at most two
|
| 6 |
+
computation bits. This is the actual unary-clock operator. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
open Matrix
|
| 11 |
+
open scoped BigOperators Classical
|
| 12 |
+
|
| 13 |
+
abbrev QMACircuitQubit (c : QMACircuit) := Fin (c.gates.length+2) ⊕ Fin (c.work+1)
|
| 14 |
+
|
| 15 |
+
def qmaCircuitQubitSplit (c : QMACircuit) :
|
| 16 |
+
(QMACircuitQubit c → Fin 2) ≃ QMAUnaryBasis c :=
|
| 17 |
+
Equiv.sumArrowEquivProdArrow _ _ _
|
| 18 |
+
|
| 19 |
+
def qmaPropagationSites (c : QMACircuit) (t : Fin c.gates.length) : Finset (QMACircuitQubit c) :=
|
| 20 |
+
{Sum.inl (qmaClockLeft c.gates.length t),Sum.inl (qmaClockMiddle c.gates.length t),
|
| 21 |
+
Sum.inl (qmaClockRight c.gates.length t)} ∪
|
| 22 |
+
(qmaGateSites c.work (c.gates.getD t.val (.hadamard 0))).map Function.Embedding.inr
|
| 23 |
+
|
| 24 |
+
theorem qmaPropagationSites_card (c : QMACircuit) (t : Fin c.gates.length) :
|
| 25 |
+
(qmaPropagationSites c t).card ≤ 5 := by
|
| 26 |
+
have h := Finset.card_union_le
|
| 27 |
+
({Sum.inl (qmaClockLeft c.gates.length t),Sum.inl (qmaClockMiddle c.gates.length t),
|
| 28 |
+
Sum.inl (qmaClockRight c.gates.length t)} : Finset (QMACircuitQubit c))
|
| 29 |
+
((qmaGateSites c.work (c.gates.getD t.val (.hadamard 0))).map Function.Embedding.inr)
|
| 30 |
+
have hclock : ({Sum.inl (qmaClockLeft c.gates.length t),
|
| 31 |
+
Sum.inl (qmaClockMiddle c.gates.length t),Sum.inl (qmaClockRight c.gates.length t)} :
|
| 32 |
+
Finset (QMACircuitQubit c)).card ≤ 3 := by
|
| 33 |
+
apply le_trans (Finset.card_insert_le _ _)
|
| 34 |
+
have h2 := Finset.card_insert_le (Sum.inl (qmaClockMiddle c.gates.length t))
|
| 35 |
+
({Sum.inl (qmaClockRight c.gates.length t)} : Finset (QMACircuitQubit c))
|
| 36 |
+
simp only [Finset.card_singleton] at h2
|
| 37 |
+
omega
|
| 38 |
+
have hgate := qmaGateSites_card c.work (c.gates.getD t.val (.hadamard 0))
|
| 39 |
+
simp only [Finset.card_map] at h
|
| 40 |
+
unfold qmaPropagationSites
|
| 41 |
+
omega
|
| 42 |
+
|
| 43 |
+
def qmaGuardProjection (c : QMACircuit) (t : Fin c.gates.length) :
|
| 44 |
+
Matrix (QMACircuitQubit c → Fin 2) (QMACircuitQubit c → Fin 2) ℂ :=
|
| 45 |
+
Matrix.diagonal (fun s => if QMAClockGuard c.gates.length t (s ∘ Sum.inl) ∧
|
| 46 |
+
s (Sum.inl (qmaClockMiddle c.gates.length t)) = 0 then 1 else 0)
|
| 47 |
+
|
| 48 |
+
def qmaLocalPropagationDelta (c : QMACircuit) (t : Fin c.gates.length) :
|
| 49 |
+
Matrix (QMACircuitQubit c → Fin 2) (QMACircuitQubit c → Fin 2) ℂ :=
|
| 50 |
+
qmaGuardProjection c t *
|
| 51 |
+
(qmaBitFlipMatrix (Sum.inl (qmaClockMiddle c.gates.length t))-
|
| 52 |
+
qmaJoinMatrix 1 (qmaStepMatrix c t.val))
|
| 53 |
+
|
| 54 |
+
theorem qmaGuardProjection_local (c : QMACircuit) (t : Fin c.gates.length) :
|
| 55 |
+
QMALocalOn (qmaPropagationSites c t) (qmaGuardProjection c t) := by
|
| 56 |
+
apply qmaLocalOn_diagonal
|
| 57 |
+
intro s r h
|
| 58 |
+
have hl := h (Sum.inl (qmaClockLeft c.gates.length t)) (by simp [qmaPropagationSites])
|
| 59 |
+
have hm := h (Sum.inl (qmaClockMiddle c.gates.length t)) (by simp [qmaPropagationSites])
|
| 60 |
+
have hr := h (Sum.inl (qmaClockRight c.gates.length t)) (by simp [qmaPropagationSites])
|
| 61 |
+
simp only [QMAClockGuard,Function.comp_apply,hl,hm,hr]
|
| 62 |
+
split_ifs with hp
|
| 63 |
+
· exact (ite_eq_left hp).symm
|
| 64 |
+
· exact (ite_eq_right hp).symm
|
| 65 |
+
|
| 66 |
+
theorem qmaLocalPropagationDelta_local (c : QMACircuit) (t : Fin c.gates.length) :
|
| 67 |
+
QMALocalOn (qmaPropagationSites c t) (qmaLocalPropagationDelta c t) := by
|
| 68 |
+
have hf := (qmaBitFlipMatrix_local (Sum.inl (qmaClockMiddle c.gates.length t))).mono
|
| 69 |
+
(T := qmaPropagationSites c t)
|
| 70 |
+
(by intro i hi; simp only [Finset.mem_singleton] at hi; subst i; simp [qmaPropagationSites])
|
| 71 |
+
have hg := ((qmaGateMatrix_local c.work (c.gates.getD t.val (.hadamard 0))).joinRight
|
| 72 |
+
(ι := Fin (c.gates.length+2))).mono (T := qmaPropagationSites c t) (Finset.subset_union_right)
|
| 73 |
+
have hn := hg.smul (-1)
|
| 74 |
+
have hs := hf.add hn
|
| 75 |
+
simp only [neg_one_smul,←sub_eq_add_neg] at hs
|
| 76 |
+
exact (qmaGuardProjection_local c t).mul hs
|
| 77 |
+
|
| 78 |
+
theorem qmaLocalPropagationGram_local (c : QMACircuit) (t : Fin c.gates.length) :
|
| 79 |
+
QMALocalOn (qmaPropagationSites c t)
|
| 80 |
+
((qmaLocalPropagationDelta c t).conjTranspose*qmaLocalPropagationDelta c t) :=
|
| 81 |
+
(qmaLocalPropagationDelta_local c t).adjoint.mul (qmaLocalPropagationDelta_local c t)
|
| 82 |
+
|
| 83 |
+
end ContinuumCoulomb
|
| 84 |
+
|
| 85 |
+
end
|
| 86 |
+
|
| 87 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalRealification.lean
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalCoordinates
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! The realification uses one shared extra qubit and adds at most one
|
| 6 |
+
qubit to each interaction support. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
open Matrix
|
| 11 |
+
open scoped BigOperators Classical
|
| 12 |
+
|
| 13 |
+
variable {ι : Type*} [Fintype ι] [DecidableEq ι]
|
| 14 |
+
|
| 15 |
+
def qmaRebitSites (S : Finset ι) : Finset (Unit ⊕ ι) :=
|
| 16 |
+
insert (Sum.inl ()) (S.map Function.Embedding.inr)
|
| 17 |
+
|
| 18 |
+
def qmaRebitOnQubits (A : Matrix (ι → Fin 2) (ι → Fin 2) ℂ) :
|
| 19 |
+
Matrix (Unit ⊕ ι → Fin 2) (Unit ⊕ ι → Fin 2) ℂ :=
|
| 20 |
+
fun s t => qmaRebitMatrix A (s (Sum.inl ()),s ∘ Sum.inr) (t (Sum.inl ()),t ∘ Sum.inr)
|
| 21 |
+
|
| 22 |
+
omit [Fintype ι] in
|
| 23 |
+
theorem qmaRebitSites_card (S : Finset ι) : (qmaRebitSites S).card = S.card+1 := by
|
| 24 |
+
simp [qmaRebitSites]
|
| 25 |
+
|
| 26 |
+
theorem qmaRebitOnQubits_local {S : Finset ι}
|
| 27 |
+
{A : Matrix (ι → Fin 2) (ι → Fin 2) ℂ} (hA : QMALocalOn S A) :
|
| 28 |
+
QMALocalOn (qmaRebitSites S) (qmaRebitOnQubits A) := by
|
| 29 |
+
obtain ⟨B,rfl⟩ := hA
|
| 30 |
+
let z : {i // i ∈ qmaRebitSites S} := ⟨Sum.inl (),by simp [qmaRebitSites]⟩
|
| 31 |
+
let k : {i // i ∈ S} → {i // i ∈ qmaRebitSites S} := fun i =>
|
| 32 |
+
⟨Sum.inr i.val,by simp [qmaRebitSites,i.property]⟩
|
| 33 |
+
refine ⟨(fun u v => qmaRebitMatrix B (u z,u ∘ k) (v z,v ∘ k)),?_⟩
|
| 34 |
+
ext s t
|
| 35 |
+
change qmaRebitMatrix (qmaLocalLift S B) (s (Sum.inl ()),s ∘ Sum.inr)
|
| 36 |
+
(t (Sum.inl ()),t ∘ Sum.inr) =
|
| 37 |
+
qmaRebitMatrix B (s (Sum.inl ()),fun i => s (Sum.inr i.val))
|
| 38 |
+
(t (Sum.inl ()),fun i => t (Sum.inr i.val))*
|
| 39 |
+
if (fun i : {i // i ∉ qmaRebitSites S} => s i.val) =
|
| 40 |
+
(fun i : {i // i ∉ qmaRebitSites S} => t i.val) then 1 else 0
|
| 41 |
+
have he : ((fun i : {i // i ∉ qmaRebitSites S} => s i.val) =
|
| 42 |
+
(fun i : {i // i ∉ qmaRebitSites S} => t i.val)) ↔
|
| 43 |
+
((fun i : {i // i ∉ S} => s (Sum.inr i.val)) =
|
| 44 |
+
(fun i : {i // i ∉ S} => t (Sum.inr i.val))) := by
|
| 45 |
+
constructor
|
| 46 |
+
· intro h
|
| 47 |
+
funext i
|
| 48 |
+
exact congrFun h ⟨Sum.inr i.val,by simpa [qmaRebitSites] using i.property⟩
|
| 49 |
+
· intro h
|
| 50 |
+
funext i
|
| 51 |
+
rcases i with ⟨i,hi⟩
|
| 52 |
+
cases i with
|
| 53 |
+
| inl j => exact False.elim (hi (by simp [qmaRebitSites]))
|
| 54 |
+
| inr j => exact congrFun h ⟨j,by simpa [qmaRebitSites] using hi⟩
|
| 55 |
+
by_cases hr : (fun i : {i // i ∉ S} => s (Sum.inr i.val)) =
|
| 56 |
+
(fun i : {i // i ∉ S} => t (Sum.inr i.val))
|
| 57 |
+
· have hr' := he.mpr hr
|
| 58 |
+
simp only [qmaRebitMatrix,qmaLocalLift_apply,
|
| 59 |
+
Function.comp_apply,hr,hr',ite_true,mul_one]
|
| 60 |
+
· have hr' : (fun i : {i // i ∉ qmaRebitSites S} => s i.val) ≠
|
| 61 |
+
(fun i : {i // i ∉ qmaRebitSites S} => t i.val) := fun h => hr (he.mp h)
|
| 62 |
+
simp only [qmaRebitMatrix,qmaLocalLift_apply,
|
| 63 |
+
Function.comp_apply,hr,hr',ite_false,mul_zero,Complex.zero_re,Complex.zero_im,
|
| 64 |
+
Complex.ofReal_zero,neg_zero,ite_self]
|
| 65 |
+
|
| 66 |
+
omit [Fintype ι] [DecidableEq ι] in
|
| 67 |
+
theorem qmaRebitOnQubits_add (A B : Matrix (ι → Fin 2) (ι → Fin 2) ℂ) :
|
| 68 |
+
qmaRebitOnQubits (A+B) = qmaRebitOnQubits A+qmaRebitOnQubits B := by
|
| 69 |
+
ext s t
|
| 70 |
+
simp only [qmaRebitOnQubits,qmaRebitMatrix,Matrix.add_apply,Complex.add_re,Complex.add_im]
|
| 71 |
+
split_ifs <;> push_cast <;> ring
|
| 72 |
+
|
| 73 |
+
omit [Fintype ι] [DecidableEq ι] in
|
| 74 |
+
theorem qmaRebitOnQubits_smul (a : ℝ) (A : Matrix (ι → Fin 2) (ι → Fin 2) ℂ) :
|
| 75 |
+
qmaRebitOnQubits ((a:ℂ) • A) = (a:ℂ) • qmaRebitOnQubits A := by
|
| 76 |
+
ext s t
|
| 77 |
+
simp only [qmaRebitOnQubits,qmaRebitMatrix,Matrix.smul_apply,smul_eq_mul,
|
| 78 |
+
Complex.mul_re,Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im,zero_mul,
|
| 79 |
+
add_zero,sub_zero]
|
| 80 |
+
split_ifs <;> push_cast <;> ring
|
| 81 |
+
|
| 82 |
+
end ContinuumCoulomb
|
| 83 |
+
|
| 84 |
+
end
|
| 85 |
+
|
| 86 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalSubdivision.lean
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliSubdivision
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalPauli
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Each real local family admits the actual simultaneous subdivision step. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
open Matrix
|
| 11 |
+
open scoped BigOperators Classical
|
| 12 |
+
variable {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α]
|
| 13 |
+
|
| 14 |
+
theorem qmaLocalSubdivision_exists (F : α → Matrix (ι → Fin 2) (ι → Fin 2) ℂ)
|
| 15 |
+
(S : α → Finset ι) {d : ℕ} (hS : ∀ a, (S a).card ≤ 2*d)
|
| 16 |
+
(hF : ∀ a, QMALocalOn (S a) (F a)) (hH : ∀ a, (F a).IsHermitian)
|
| 17 |
+
(hR : ∀ a, QMAEntryParity false (F a)) {N : ℝ} (hN : 1 ≤ N) :
|
| 18 |
+
∃ G : (QMALocalEvenPauliTerm S × Fin 4) →
|
| 19 |
+
Matrix (ι ⊕ QMALocalEvenPauliTerm S → Fin 2) (ι ⊕ QMALocalEvenPauliTerm S → Fin 2) ℂ,
|
| 20 |
+
(∀ p, (G p).IsHermitian) ∧ (∀ p, QMAEntryParity false (G p)) ∧
|
| 21 |
+
(∀ p, ∃ T : Finset (ι ⊕ QMALocalEvenPauliTerm S), T.card ≤ d+1 ∧ QMALocalOn T (G p)) ∧
|
| 22 |
+
|MediatorGraph.normalizedBottom (∑ p, G p)-MediatorGraph.normalizedBottom (∑ a, F a)| ≤ 1/N := by
|
| 23 |
+
obtain ⟨G,hGH,hGR,hGS,hGE⟩ := qmaPauliSubdivision_exists
|
| 24 |
+
(fun p : QMALocalEvenPauliTerm S => qmaLocalPauliWord S p.val)
|
| 25 |
+
(fun p => qmaLocalPauliCoefficient F S p.val)
|
| 26 |
+
(qmaLocalEvenPauli_support S hS) (qmaLocalEvenPauli_even S) hN
|
| 27 |
+
refine ⟨G,hGH,hGR,hGS,?_⟩
|
| 28 |
+
have hs : (∑ p : QMALocalEvenPauliTerm S,
|
| 29 |
+
(qmaLocalPauliCoefficient F S p.val : ℂ) • qmaPauliWord (qmaLocalPauliWord S p.val)) =
|
| 30 |
+
∑ a, F a := qmaLocalEvenPauli_sum F S hF hH hR
|
| 31 |
+
rwa [hs] at hGE
|
| 32 |
+
|
| 33 |
+
theorem qmaLocalSubdivision_size (S : α → Finset ι) {d : ℕ} (hS : ∀ a, (S a).card ≤ 2*d) :
|
| 34 |
+
Fintype.card (ι ⊕ QMALocalEvenPauliTerm S) ≤ Fintype.card ι+4^(2*d)*Fintype.card α ∧
|
| 35 |
+
Fintype.card (QMALocalEvenPauliTerm S × Fin 4) ≤ 4*4^(2*d)*Fintype.card α := by
|
| 36 |
+
have hc := qmaLocalEvenPauli_count S hS
|
| 37 |
+
simp only [Fintype.card_sum,Fintype.card_prod,Fintype.card_fin]
|
| 38 |
+
constructor <;> nlinarith
|
| 39 |
+
|
| 40 |
+
end ContinuumCoulomb
|
| 41 |
+
|
| 42 |
+
end
|
| 43 |
+
|
| 44 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalSupported.lean
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSupportedSubdivision
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalPauli
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Each real local family admits the actual simultaneous subdivision step. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
open Matrix
|
| 11 |
+
open scoped BigOperators Classical
|
| 12 |
+
variable {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α]
|
| 13 |
+
|
| 14 |
+
theorem qmaLocalSubdivision_supported (F : α → Matrix (ι → Fin 2) (ι → Fin 2) ℂ)
|
| 15 |
+
(S : α → Finset ι) {d : ℕ} (hS : ∀ a, (S a).card ≤ 2*d)
|
| 16 |
+
(hF : ∀ a, QMALocalOn (S a) (F a)) (hH : ∀ a, (F a).IsHermitian)
|
| 17 |
+
(hR : ∀ a, QMAEntryParity false (F a)) {N : ℝ} (hN : 1 ≤ N) :
|
| 18 |
+
∃ G : (QMALocalEvenPauliTerm S × Fin 4) →
|
| 19 |
+
Matrix (ι ⊕ QMALocalEvenPauliTerm S → Fin 2) (ι ⊕ QMALocalEvenPauliTerm S → Fin 2) ℂ,
|
| 20 |
+
(∀ p, (G p).IsHermitian) ∧ (∀ p, QMAEntryParity false (G p)) ∧
|
| 21 |
+
(∀ p, ∃ T : Finset (ι ⊕ QMALocalEvenPauliTerm S), T.card ≤ d+1 ∧ QMALocalOn T (G p) ∧
|
| 22 |
+
T ⊆ qmaMediatorSupport (S p.1.val.1) p.1) ∧
|
| 23 |
+
|MediatorGraph.normalizedBottom (∑ p, G p)-MediatorGraph.normalizedBottom (∑ a, F a)| ≤ 1/N := by
|
| 24 |
+
obtain ⟨G,hGH,hGR,hGS,hGE⟩ := qmaPauliSubdivision_supported
|
| 25 |
+
(fun p : QMALocalEvenPauliTerm S => qmaLocalPauliWord S p.val)
|
| 26 |
+
(fun p => qmaLocalPauliCoefficient F S p.val)
|
| 27 |
+
(qmaLocalEvenPauli_support S hS) (qmaLocalEvenPauli_even S) hN
|
| 28 |
+
refine ⟨G,hGH,hGR,?_,?_⟩
|
| 29 |
+
· intro p
|
| 30 |
+
obtain ⟨T,hTc,hTl,hTs⟩ := hGS p
|
| 31 |
+
exact ⟨T,hTc,hTl,hTs.trans (qmaMediatorSupport_mono (qmaPauliExtend_support _ _) _)⟩
|
| 32 |
+
· have hs : (∑ p : QMALocalEvenPauliTerm S,
|
| 33 |
+
(qmaLocalPauliCoefficient F S p.val : ℂ) • qmaPauliWord (qmaLocalPauliWord S p.val)) =
|
| 34 |
+
∑ a, F a := qmaLocalEvenPauli_sum F S hF hH hR
|
| 35 |
+
rwa [hs] at hGE
|
| 36 |
+
|
| 37 |
+
end ContinuumCoulomb
|
| 38 |
+
|
| 39 |
+
end
|
| 40 |
+
|
| 41 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalTensor.lean
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalLift
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Tensor products with identity spectators are actual finite-support
|
| 6 |
+
operators, with their small matrix given explicitly. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
open Matrix
|
| 11 |
+
open scoped BigOperators Kronecker
|
| 12 |
+
|
| 13 |
+
variable {ι : Type*} [Fintype ι] [DecidableEq ι]
|
| 14 |
+
|
| 15 |
+
theorem qmaLocalLift_apply (S : Finset ι)
|
| 16 |
+
(A : Matrix (QMASupportBasis S) (QMASupportBasis S) ℂ) (s t : ι → Fin 2) :
|
| 17 |
+
qmaLocalLift S A s t =
|
| 18 |
+
A (fun i => s i.val) (fun i => t i.val)*
|
| 19 |
+
if (fun i : {i // i ∉ S} => s i.val) = (fun i : {i // i ∉ S} => t i.val) then 1 else 0 := by
|
| 20 |
+
rfl
|
| 21 |
+
|
| 22 |
+
theorem qmaLocalOn_permutation (S : Finset ι) (F : (ι → Fin 2) → (ι → Fin 2))
|
| 23 |
+
(f : QMASupportBasis S → QMASupportBasis S)
|
| 24 |
+
(hcore : ∀ t, (qmaSupportSplit S (F t)).1 = f (qmaSupportSplit S t).1)
|
| 25 |
+
(hrest : ∀ t, (qmaSupportSplit S (F t)).2 = (qmaSupportSplit S t).2) :
|
| 26 |
+
QMALocalOn S (fun s t => if s = F t then (1:ℂ) else 0) := by
|
| 27 |
+
refine ⟨(fun s t => if s = f t then 1 else 0),?_⟩
|
| 28 |
+
ext s t
|
| 29 |
+
change (if s = F t then (1:ℂ) else 0) =
|
| 30 |
+
(if (qmaSupportSplit S s).1 = f (qmaSupportSplit S t).1 then 1 else 0)*
|
| 31 |
+
if (qmaSupportSplit S s).2 = (qmaSupportSplit S t).2 then 1 else 0
|
| 32 |
+
by_cases hr : (qmaSupportSplit S s).2 = (qmaSupportSplit S t).2
|
| 33 |
+
· have he : (qmaSupportSplit S s).1 = f (qmaSupportSplit S t).1 ↔ s = F t := by
|
| 34 |
+
constructor
|
| 35 |
+
· intro hc
|
| 36 |
+
apply (qmaSupportSplit S).injective
|
| 37 |
+
exact Prod.ext (hc.trans (hcore t).symm) (hr.trans (hrest t).symm)
|
| 38 |
+
· intro h
|
| 39 |
+
subst s
|
| 40 |
+
exact hcore t
|
| 41 |
+
simp [hr,he]
|
| 42 |
+
· have he : s ≠ F t := by
|
| 43 |
+
intro h
|
| 44 |
+
subst s
|
| 45 |
+
exact hr (hrest t)
|
| 46 |
+
simp [hr,he]
|
| 47 |
+
|
| 48 |
+
theorem qmaLocalOn_sourceTensor (n : ℕ) (S : Finset (Fin n))
|
| 49 |
+
(M : Fin n → Matrix (Fin 2) (Fin 2) ℂ) (hM : ∀ i, i ∉ S → M i = 1) :
|
| 50 |
+
QMALocalOn S (sourceTensor n M) := by
|
| 51 |
+
refine ⟨(fun s t => ∏ i : {i // i ∈ S}, M i.val (s i) (t i)),?_⟩
|
| 52 |
+
ext s t
|
| 53 |
+
change (∏ i, M i (s i) (t i)) =
|
| 54 |
+
(∏ i : {i // i ∈ S}, M i.val (s i.val) (t i.val))*
|
| 55 |
+
if (fun i : {i // i ∉ S} => s i.val) = (fun i : {i // i ∉ S} => t i.val) then 1 else 0
|
| 56 |
+
by_cases hr : (fun i : {i // i ∉ S} => s i.val) = (fun i : {i // i ∉ S} => t i.val)
|
| 57 |
+
· rw [ite_eq_left hr,mul_one]
|
| 58 |
+
have he (i : Fin n) (_hi : i ∈ Finset.univ) (hi : i ∉ S) : M i (s i) (t i) = 1 := by
|
| 59 |
+
rw [hM i hi]
|
| 60 |
+
have ht := congrFun hr ⟨i,hi⟩
|
| 61 |
+
exact ite_eq_left ht
|
| 62 |
+
have hp := Finset.prod_subset (Finset.subset_univ S) he
|
| 63 |
+
have hs := Finset.prod_subtype (F := inferInstance) S
|
| 64 |
+
(by simp : ∀ i, i ∈ S ↔ i ∈ S) (fun i => M i (s i) (t i))
|
| 65 |
+
exact hp.symm.trans hs
|
| 66 |
+
· rw [ite_eq_right hr,mul_zero]
|
| 67 |
+
obtain ⟨i,hi⟩ := Function.ne_iff.mp hr
|
| 68 |
+
apply Finset.prod_eq_zero (Finset.mem_univ i.val)
|
| 69 |
+
rw [hM i.val i.property]
|
| 70 |
+
exact ite_eq_right hi
|
| 71 |
+
|
| 72 |
+
end ContinuumCoulomb
|
| 73 |
+
|
| 74 |
+
end
|
| 75 |
+
|
| 76 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalThird.lean
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPauliThird
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalPauli
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! A real three-local family reduces to a real two-local family, with
|
| 7 |
+
seven output terms per even Pauli word and the actual spectral error. -/
|
| 8 |
+
|
| 9 |
+
noncomputable section
|
| 10 |
+
namespace ContinuumCoulomb
|
| 11 |
+
open Matrix
|
| 12 |
+
open scoped BigOperators Classical
|
| 13 |
+
variable {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α]
|
| 14 |
+
|
| 15 |
+
theorem qmaLocalThird_exists (F : α → Matrix (ι → Fin 2) (ι → Fin 2) ℂ)
|
| 16 |
+
(S : α → Finset ι) (hS : ∀ a, (S a).card ≤ 3)
|
| 17 |
+
(hF : ∀ a, QMALocalOn (S a) (F a)) (hH : ∀ a, (F a).IsHermitian)
|
| 18 |
+
(hR : ∀ a, QMAEntryParity false (F a)) {N : ℝ} (hN : 1 ≤ N) :
|
| 19 |
+
∃ G : (QMALocalEvenPauliTerm S × Fin 7) →
|
| 20 |
+
Matrix (ι ⊕ QMALocalEvenPauliTerm S → Fin 2) (ι ⊕ QMALocalEvenPauliTerm S → Fin 2) ℂ,
|
| 21 |
+
(∀ p, (G p).IsHermitian) ∧ (∀ p, QMAEntryParity false (G p)) ∧
|
| 22 |
+
(∀ p, ∃ T : Finset (ι ⊕ QMALocalEvenPauliTerm S), T.card ≤ 2 ∧ QMALocalOn T (G p)) ∧
|
| 23 |
+
|MediatorGraph.normalizedBottom (∑ p, G p)-MediatorGraph.normalizedBottom (∑ a, F a)| ≤ 1/N := by
|
| 24 |
+
obtain ⟨G,hGH,hGR,hGS,hGE⟩ := qmaPauliThird_exists
|
| 25 |
+
(fun p : QMALocalEvenPauliTerm S => qmaLocalPauliWord S p.val)
|
| 26 |
+
(fun p => qmaLocalPauliCoefficient F S p.val)
|
| 27 |
+
(qmaLocalEvenPauli_support S hS) (qmaLocalEvenPauli_even S) hN
|
| 28 |
+
refine ⟨G,hGH,hGR,hGS,?_⟩
|
| 29 |
+
have hs : (∑ p : QMALocalEvenPauliTerm S,
|
| 30 |
+
(qmaLocalPauliCoefficient F S p.val : ℂ) • qmaPauliWord (qmaLocalPauliWord S p.val)) =
|
| 31 |
+
∑ a, F a := qmaLocalEvenPauli_sum F S hF hH hR
|
| 32 |
+
rwa [hs] at hGE
|
| 33 |
+
|
| 34 |
+
theorem qmaLocalThird_size (S : α → Finset ι) (hS : ∀ a, (S a).card ≤ 3) :
|
| 35 |
+
Fintype.card (ι ⊕ QMALocalEvenPauliTerm S) ≤ Fintype.card ι+64*Fintype.card α ∧
|
| 36 |
+
Fintype.card (QMALocalEvenPauliTerm S × Fin 7) ≤ 448*Fintype.card α := by
|
| 37 |
+
have hc := qmaLocalEvenPauli_count S hS
|
| 38 |
+
norm_num only [show (4:ℕ)^3 = 64 by norm_num] at hc
|
| 39 |
+
simp only [Fintype.card_sum,Fintype.card_prod,Fintype.card_fin]
|
| 40 |
+
constructor <;> omega
|
| 41 |
+
|
| 42 |
+
end ContinuumCoulomb
|
| 43 |
+
|
| 44 |
+
end
|
| 45 |
+
|
| 46 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumLocalThirdSupported.lean
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSupportedThird
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalPauli
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Each real local family admits the actual simultaneous subdivision step. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
open Matrix
|
| 11 |
+
open scoped BigOperators Classical
|
| 12 |
+
variable {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α]
|
| 13 |
+
|
| 14 |
+
theorem qmaLocalThird_supported (F : α → Matrix (ι → Fin 2) (ι → Fin 2) ℂ)
|
| 15 |
+
(S : α → Finset ι) (hS : ∀ a, (S a).card ≤ 3)
|
| 16 |
+
(hF : ∀ a, QMALocalOn (S a) (F a)) (hH : ∀ a, (F a).IsHermitian)
|
| 17 |
+
(hR : ∀ a, QMAEntryParity false (F a)) {N : ℝ} (hN : 1 ≤ N) :
|
| 18 |
+
∃ G : (QMALocalEvenPauliTerm S × Fin 7) →
|
| 19 |
+
Matrix (ι ⊕ QMALocalEvenPauliTerm S → Fin 2) (ι ⊕ QMALocalEvenPauliTerm S → Fin 2) ℂ,
|
| 20 |
+
(∀ p, (G p).IsHermitian) ∧ (∀ p, QMAEntryParity false (G p)) ∧
|
| 21 |
+
(∀ p, ∃ T : Finset (ι ⊕ QMALocalEvenPauliTerm S), T.card ≤ 2 ∧ QMALocalOn T (G p) ∧
|
| 22 |
+
T ⊆ qmaMediatorSupport (S p.1.val.1) p.1) ∧
|
| 23 |
+
|MediatorGraph.normalizedBottom (∑ p, G p)-MediatorGraph.normalizedBottom (∑ a, F a)| ≤ 1/N := by
|
| 24 |
+
obtain ⟨G,hGH,hGR,hGS,hGE⟩ := qmaPauliThird_supported
|
| 25 |
+
(fun p : QMALocalEvenPauliTerm S => qmaLocalPauliWord S p.val)
|
| 26 |
+
(fun p => qmaLocalPauliCoefficient F S p.val)
|
| 27 |
+
(qmaLocalEvenPauli_support S hS) (qmaLocalEvenPauli_even S) hN
|
| 28 |
+
refine ⟨G,hGH,hGR,?_,?_⟩
|
| 29 |
+
· intro p
|
| 30 |
+
obtain ⟨T,hTc,hTl,hTs⟩ := hGS p
|
| 31 |
+
exact ⟨T,hTc,hTl,hTs.trans (qmaMediatorSupport_mono (qmaPauliExtend_support _ _) _)⟩
|
| 32 |
+
· have hs : (∑ p : QMALocalEvenPauliTerm S,
|
| 33 |
+
(qmaLocalPauliCoefficient F S p.val : ℂ) • qmaPauliWord (qmaLocalPauliWord S p.val)) =
|
| 34 |
+
∑ a, F a := qmaLocalEvenPauli_sum F S hF hH hR
|
| 35 |
+
rwa [hs] at hGE
|
| 36 |
+
|
| 37 |
+
end ContinuumCoulomb
|
| 38 |
+
|
| 39 |
+
end
|
| 40 |
+
|
| 41 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumManhattanListProgram.lean
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteProgram
|
| 2 |
+
import OAI.Computability.QuantumFactoring.BitStackBoundedUnary
|
| 3 |
+
import OAI.Computability.QuantumFactoring.BitStackTabulate
|
| 4 |
+
|
| 5 |
+
namespace OAI
|
| 6 |
+
|
| 7 |
+
/-! Enumerate the Manhattan segment with an explicit fixed route budget.
|
| 8 |
+
The cap makes enumeration polynomial on every input, and disappears for
|
| 9 |
+
the spatial routes satisfying the proved length bound. -/
|
| 10 |
+
|
| 11 |
+
noncomputable section
|
| 12 |
+
namespace ContinuumCoulomb.QuantumManhattanListProgram
|
| 13 |
+
open ExactQuantumFactoring.BitStackProgram QuantumRouteCode
|
| 14 |
+
|
| 15 |
+
abbrev Ends := Pair × Pair
|
| 16 |
+
def endsCode : Ends → List Bool := prodCode pairCode pairCode
|
| 17 |
+
|
| 18 |
+
def value (K : ℕ) (x : Ends) : List Pair :=
|
| 19 |
+
(List.range (min K (qmaManhattanLength x.1 x.2)+1)).map (qmaManhattanPoint x.1 x.2)
|
| 20 |
+
|
| 21 |
+
noncomputable def distanceProgram : Procedure endsCode Nat.bits
|
| 22 |
+
(fun x => qmaManhattanLength x.1 x.2) :=
|
| 23 |
+
QuantumRouteCode.lengthProgram.comp
|
| 24 |
+
((Procedure.identity endsCode).pair (Procedure.constant endsCode Nat.bits 0))
|
| 25 |
+
|
| 26 |
+
noncomputable def program (K : ℕ) : Procedure endsCode (listCode pairCode) (value K) := by
|
| 27 |
+
let length := Procedure.clippedUnary.comp
|
| 28 |
+
((Procedure.constant endsCode unaryCode K).pair distanceProgram)
|
| 29 |
+
let point := QuantumRouteCode.pointProgram.comp
|
| 30 |
+
((Procedure.second unaryCode endsCode).pair
|
| 31 |
+
(Procedure.unaryToBits.comp (Procedure.first unaryCode endsCode)))
|
| 32 |
+
exact (Procedure.tabulate (f := fun x i => qmaManhattanPoint x.1 x.2 i) (0,0) point).comp
|
| 33 |
+
((Procedure.unarySuccessor.comp length).pair (Procedure.identity endsCode))
|
| 34 |
+
|
| 35 |
+
theorem value_exact (K : ℕ) (x : Ends) (h : qmaManhattanLength x.1 x.2 ≤ K) :
|
| 36 |
+
value K x = (List.range (qmaManhattanLength x.1 x.2+1)).map (qmaManhattanPoint x.1 x.2) := by
|
| 37 |
+
simp only [value,Nat.min_eq_right h]
|
| 38 |
+
|
| 39 |
+
end ContinuumCoulomb.QuantumManhattanListProgram
|
| 40 |
+
|
| 41 |
+
end
|
| 42 |
+
|
| 43 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumManhattanRoute.lean
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridSlots
|
| 2 |
+
import Mathlib.Data.Nat.Dist
|
| 3 |
+
import Mathlib.Data.Int.NatAbs
|
| 4 |
+
|
| 5 |
+
namespace OAI
|
| 6 |
+
|
| 7 |
+
/-! Short, simple lattice paths between the bounded-density fine-grid sites. -/
|
| 8 |
+
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
|
| 11 |
+
def qmaAxisWalk (a b k : ℕ) : ℕ := if a ≤ b then a+k else a-k
|
| 12 |
+
|
| 13 |
+
@[simp] theorem qmaAxisWalk_zero (a b : ℕ) : qmaAxisWalk a b 0 = a := by
|
| 14 |
+
simp [qmaAxisWalk]
|
| 15 |
+
|
| 16 |
+
@[simp] theorem qmaAxisWalk_last (a b : ℕ) : qmaAxisWalk a b (Nat.dist a b) = b := by
|
| 17 |
+
unfold qmaAxisWalk Nat.dist
|
| 18 |
+
split_ifs <;> omega
|
| 19 |
+
|
| 20 |
+
theorem qmaAxisWalk_distance (a b k : ℕ) (hk : k ≤ Nat.dist a b) :
|
| 21 |
+
Nat.dist a (qmaAxisWalk a b k) = k := by
|
| 22 |
+
unfold qmaAxisWalk Nat.dist at *
|
| 23 |
+
split_ifs <;> omega
|
| 24 |
+
|
| 25 |
+
theorem qmaAxisWalk_step (a b k : ℕ) (hk : k < Nat.dist a b) :
|
| 26 |
+
Nat.dist (qmaAxisWalk a b k) (qmaAxisWalk a b (k+1)) = 1 := by
|
| 27 |
+
unfold qmaAxisWalk Nat.dist at *
|
| 28 |
+
split_ifs <;> omega
|
| 29 |
+
|
| 30 |
+
theorem qmaAxisWalk_bounds (a b k : ℕ) (hk : k ≤ Nat.dist a b) :
|
| 31 |
+
min a b ≤ qmaAxisWalk a b k ∧ qmaAxisWalk a b k ≤ max a b := by
|
| 32 |
+
unfold qmaAxisWalk Nat.dist at *
|
| 33 |
+
split_ifs <;> omega
|
| 34 |
+
|
| 35 |
+
def qmaManhattanLength (p q : ℕ × ℕ) : ℕ := Nat.dist p.1 q.1+Nat.dist p.2 q.2
|
| 36 |
+
|
| 37 |
+
def qmaManhattanPoint (p q : ℕ × ℕ) (k : ℕ) : ℕ × ℕ :=
|
| 38 |
+
if k ≤ Nat.dist p.1 q.1 then (qmaAxisWalk p.1 q.1 k,p.2)
|
| 39 |
+
else (q.1,qmaAxisWalk p.2 q.2 (k-Nat.dist p.1 q.1))
|
| 40 |
+
|
| 41 |
+
@[simp] theorem qmaManhattanPoint_zero (p q : ℕ × ℕ) : qmaManhattanPoint p q 0 = p := by
|
| 42 |
+
simp [qmaManhattanPoint]
|
| 43 |
+
|
| 44 |
+
@[simp] theorem qmaManhattanPoint_last (p q : ℕ × ℕ) :
|
| 45 |
+
qmaManhattanPoint p q (qmaManhattanLength p q) = q := by
|
| 46 |
+
by_cases h : Nat.dist p.2 q.2 = 0
|
| 47 |
+
· have he := Nat.eq_of_dist_eq_zero h
|
| 48 |
+
simp [qmaManhattanLength,qmaManhattanPoint,he]
|
| 49 |
+
· have hn : ¬qmaManhattanLength p q ≤ Nat.dist p.1 q.1 := by unfold qmaManhattanLength; omega
|
| 50 |
+
simp only [qmaManhattanPoint,ite_eq_right hn]
|
| 51 |
+
simp [qmaManhattanLength]
|
| 52 |
+
|
| 53 |
+
theorem qmaManhattanPoint_distance (p q : ℕ × ℕ) (k : ℕ) (hk : k ≤ qmaManhattanLength p q) :
|
| 54 |
+
Nat.dist p.1 (qmaManhattanPoint p q k).1+
|
| 55 |
+
Nat.dist p.2 (qmaManhattanPoint p q k).2 = k := by
|
| 56 |
+
by_cases hx : k ≤ Nat.dist p.1 q.1
|
| 57 |
+
· simp [qmaManhattanPoint,hx,qmaAxisWalk_distance _ _ _ hx]
|
| 58 |
+
· have hy : k-Nat.dist p.1 q.1 ≤ Nat.dist p.2 q.2 := by unfold qmaManhattanLength at hk; omega
|
| 59 |
+
simp only [qmaManhattanPoint,hx,ite_false]
|
| 60 |
+
rw [qmaAxisWalk_distance _ _ _ hy]
|
| 61 |
+
omega
|
| 62 |
+
|
| 63 |
+
theorem qmaManhattanPoint_step (p q : ℕ × ℕ) (k : ℕ) (hk : k < qmaManhattanLength p q) :
|
| 64 |
+
Nat.dist (qmaManhattanPoint p q k).1 (qmaManhattanPoint p q (k+1)).1+
|
| 65 |
+
Nat.dist (qmaManhattanPoint p q k).2 (qmaManhattanPoint p q (k+1)).2 = 1 := by
|
| 66 |
+
by_cases hx : k < Nat.dist p.1 q.1
|
| 67 |
+
· have hx0 : k ≤ Nat.dist p.1 q.1 := by omega
|
| 68 |
+
have hx1 : k+1 ≤ Nat.dist p.1 q.1 := by omega
|
| 69 |
+
simp [qmaManhattanPoint,hx0,hx1,qmaAxisWalk_step _ _ _ hx]
|
| 70 |
+
· by_cases he : k = Nat.dist p.1 q.1
|
| 71 |
+
· subst k
|
| 72 |
+
have hy : 0 < Nat.dist p.2 q.2 := by unfold qmaManhattanLength at hk; omega
|
| 73 |
+
simpa [qmaManhattanPoint] using qmaAxisWalk_step p.2 q.2 0 hy
|
| 74 |
+
· have hx0 : ¬k ≤ Nat.dist p.1 q.1 := by omega
|
| 75 |
+
have hx1 : ¬k+1 ≤ Nat.dist p.1 q.1 := by omega
|
| 76 |
+
have hy : k-Nat.dist p.1 q.1 < Nat.dist p.2 q.2 := by unfold qmaManhattanLength at hk; omega
|
| 77 |
+
have hs : k+1-Nat.dist p.1 q.1 = (k-Nat.dist p.1 q.1)+1 := by omega
|
| 78 |
+
simp [qmaManhattanPoint,hx0,hx1,hs,qmaAxisWalk_step _ _ _ hy]
|
| 79 |
+
|
| 80 |
+
def qmaManhattanRoute (p q : ℕ × ℕ) : Fin (qmaManhattanLength p q+1) → ℕ × ℕ :=
|
| 81 |
+
fun k => qmaManhattanPoint p q k.val
|
| 82 |
+
|
| 83 |
+
theorem qmaManhattanRoute_injective (p q : ℕ × ℕ) : Function.Injective (qmaManhattanRoute p q) := by
|
| 84 |
+
intro a b hab
|
| 85 |
+
apply Fin.ext
|
| 86 |
+
have ha := qmaManhattanPoint_distance p q a.val (by omega)
|
| 87 |
+
have hb := qmaManhattanPoint_distance p q b.val (by omega)
|
| 88 |
+
change qmaManhattanPoint p q a.val = qmaManhattanPoint p q b.val at hab
|
| 89 |
+
rw [hab] at ha
|
| 90 |
+
omega
|
| 91 |
+
|
| 92 |
+
theorem qmaManhattanPoint_bounds (p q : ℕ × ℕ) (k : ℕ) (hk : k ≤ qmaManhattanLength p q) :
|
| 93 |
+
min p.1 q.1 ≤ (qmaManhattanPoint p q k).1 ∧
|
| 94 |
+
(qmaManhattanPoint p q k).1 ≤ max p.1 q.1 ∧
|
| 95 |
+
min p.2 q.2 ≤ (qmaManhattanPoint p q k).2 ∧
|
| 96 |
+
(qmaManhattanPoint p q k).2 ≤ max p.2 q.2 := by
|
| 97 |
+
by_cases hx : k ≤ Nat.dist p.1 q.1
|
| 98 |
+
· simpa only [qmaManhattanPoint,hx,ite_true] using
|
| 99 |
+
And.intro (qmaAxisWalk_bounds _ _ _ hx).1
|
| 100 |
+
(And.intro (qmaAxisWalk_bounds _ _ _ hx).2 (And.intro (min_le_left _ _) (le_max_left _ _)))
|
| 101 |
+
· have hy : k-Nat.dist p.1 q.1 ≤ Nat.dist p.2 q.2 := by unfold qmaManhattanLength at hk; omega
|
| 102 |
+
simpa only [qmaManhattanPoint,hx,ite_false] using
|
| 103 |
+
And.intro (min_le_right _ _)
|
| 104 |
+
(And.intro (le_max_right _ _) (qmaAxisWalk_bounds _ _ _ hy))
|
| 105 |
+
|
| 106 |
+
noncomputable def qmaFineGridPoint {Q : Type*} [Fintype Q] {rows width A : ℕ}
|
| 107 |
+
(cell : Q → QMAGridCell rows width)
|
| 108 |
+
(h : ∀ p, (Finset.univ.filter (fun q => cell q = p)).card ≤ A) (q : Q) : ℕ × ℕ :=
|
| 109 |
+
((qmaFineGridSite cell h q).1.val,(qmaFineGridSite cell h q).2.val)
|
| 110 |
+
|
| 111 |
+
theorem qmaFineGridPoint_length {Q : Type*} [Fintype Q] {rows width A : ℕ}
|
| 112 |
+
(cell : Q → QMAGridCell rows width)
|
| 113 |
+
(h : ∀ p, (Finset.univ.filter (fun q => cell q = p)).card ≤ A)
|
| 114 |
+
(p q : Q) (a : QMAGridCell rows width)
|
| 115 |
+
(hp : QMAGridCellsNear (cell p) a) (hq : QMAGridCellsNear (cell q) a) :
|
| 116 |
+
qmaManhattanLength (qmaFineGridPoint cell h p) (qmaFineGridPoint cell h q) ≤ 3*A+2 := by
|
| 117 |
+
obtain ⟨hp1,hp2,hp3,hp4⟩ := qmaFineGridSite_bounds cell h p a hp
|
| 118 |
+
obtain ⟨hq1,hq2,hq3,hq4⟩ := qmaFineGridSite_bounds cell h q a hq
|
| 119 |
+
simp only [Nat.add_mul] at hp1 hq1
|
| 120 |
+
unfold qmaManhattanLength qmaFineGridPoint Nat.dist
|
| 121 |
+
omega
|
| 122 |
+
|
| 123 |
+
theorem qmaNatDist_eq_int (a b : ℕ) : Nat.dist a b = Int.natAbs ((a:ℤ)-(b:ℤ)) := by
|
| 124 |
+
by_cases h : a ≤ b
|
| 125 |
+
· rw [Nat.dist_eq_sub_of_le h,Int.natAbs_natCast_sub_natCast_of_le h]
|
| 126 |
+
· rw [Nat.dist_eq_sub_of_le_right (by omega),Int.natAbs_natCast_sub_natCast_of_ge (by omega)]
|
| 127 |
+
|
| 128 |
+
end ContinuumCoulomb
|
| 129 |
+
|
| 130 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumManhattanSupport.lean
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumManhattanRoute
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Exact support of the two-segment lattice route. -/
|
| 6 |
+
|
| 7 |
+
namespace ContinuumCoulomb
|
| 8 |
+
|
| 9 |
+
def qmaBetween (a b x : ℕ) : Prop := min a b ≤ x ∧ x ≤ max a b
|
| 10 |
+
|
| 11 |
+
def qmaManhattanSupport (p q z : ℕ × ℕ) : Prop :=
|
| 12 |
+
(z.2 = p.2 ∧ qmaBetween p.1 q.1 z.1) ∨
|
| 13 |
+
(z.1 = q.1 ∧ qmaBetween p.2 q.2 z.2)
|
| 14 |
+
|
| 15 |
+
theorem qmaAxisWalk_at_between {a b x : ℕ} (h : qmaBetween a b x) :
|
| 16 |
+
qmaAxisWalk a b (Nat.dist a x) = x ∧ Nat.dist a x ≤ Nat.dist a b := by
|
| 17 |
+
unfold qmaBetween qmaAxisWalk Nat.dist at *
|
| 18 |
+
split_ifs <;> omega
|
| 19 |
+
|
| 20 |
+
theorem qmaManhattanPoint_support (p q : ℕ × ℕ) (k : ℕ)
|
| 21 |
+
(hk : k ≤ qmaManhattanLength p q) : qmaManhattanSupport p q (qmaManhattanPoint p q k) := by
|
| 22 |
+
by_cases hx : k ≤ Nat.dist p.1 q.1
|
| 23 |
+
· left
|
| 24 |
+
simp only [qmaManhattanPoint,ite_eq_left hx]
|
| 25 |
+
exact ⟨True.intro,qmaAxisWalk_bounds _ _ _ hx⟩
|
| 26 |
+
· right
|
| 27 |
+
have hy : k-Nat.dist p.1 q.1 ≤ Nat.dist p.2 q.2 := by
|
| 28 |
+
unfold qmaManhattanLength at hk
|
| 29 |
+
omega
|
| 30 |
+
simp only [qmaManhattanPoint,ite_eq_right hx]
|
| 31 |
+
exact ⟨True.intro,qmaAxisWalk_bounds _ _ _ hy⟩
|
| 32 |
+
|
| 33 |
+
theorem qmaManhattanSupport_point {p q z : ℕ × ℕ} (hz : qmaManhattanSupport p q z) :
|
| 34 |
+
∃ k, k ≤ qmaManhattanLength p q ∧ qmaManhattanPoint p q k = z := by
|
| 35 |
+
rcases hz with ⟨hy,hx⟩ | ⟨hx,hy⟩
|
| 36 |
+
· obtain ⟨he,hk⟩ := qmaAxisWalk_at_between hx
|
| 37 |
+
refine ⟨Nat.dist p.1 z.1,by unfold qmaManhattanLength; omega,?_⟩
|
| 38 |
+
simp only [qmaManhattanPoint,ite_eq_left hk,he]
|
| 39 |
+
exact Prod.ext rfl hy.symm
|
| 40 |
+
· obtain ⟨he,hk⟩ := qmaAxisWalk_at_between hy
|
| 41 |
+
refine ⟨Nat.dist p.1 q.1+Nat.dist p.2 z.2,by unfold qmaManhattanLength; omega,?_⟩
|
| 42 |
+
by_cases hzero : Nat.dist p.2 z.2 = 0
|
| 43 |
+
· have hyz := Nat.eq_of_dist_eq_zero hzero
|
| 44 |
+
simp only [qmaManhattanPoint,hzero,add_zero,le_refl,ite_true,qmaAxisWalk_last]
|
| 45 |
+
exact Prod.ext hx.symm hyz
|
| 46 |
+
· have hn : ¬Nat.dist p.1 q.1+Nat.dist p.2 z.2 ≤ Nat.dist p.1 q.1 := by omega
|
| 47 |
+
simp only [qmaManhattanPoint,ite_eq_right hn,Nat.add_sub_cancel_left,he]
|
| 48 |
+
exact Prod.ext hx.symm rfl
|
| 49 |
+
|
| 50 |
+
theorem qmaManhattanRoute_range (p q z : ℕ × ℕ) :
|
| 51 |
+
z ∈ Set.range (qmaManhattanRoute p q) ↔ qmaManhattanSupport p q z := by
|
| 52 |
+
constructor
|
| 53 |
+
· rintro ⟨k,rfl⟩
|
| 54 |
+
exact qmaManhattanPoint_support p q k.val (by omega)
|
| 55 |
+
· intro hz
|
| 56 |
+
obtain ⟨k,hk,he⟩ := qmaManhattanSupport_point hz
|
| 57 |
+
exact ⟨⟨k,by omega⟩,he⟩
|
| 58 |
+
|
| 59 |
+
end ContinuumCoulomb
|
| 60 |
+
|
| 61 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMappedGate.lean
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumWireRouting
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Explicit gate addresses for a logical register embedded in a larger wire grid. -/
|
| 6 |
+
|
| 7 |
+
noncomputable section
|
| 8 |
+
namespace ContinuumCoulomb
|
| 9 |
+
open scoped Classical
|
| 10 |
+
|
| 11 |
+
def qmaMapGate (sourceWork targetWork : ℕ) (f : Fin (sourceWork+1) → Fin (targetWork+1)) :
|
| 12 |
+
QMAGate → QMAGate
|
| 13 |
+
| .hadamard i => .hadamard (f (qmaQubit sourceWork i)).val
|
| 14 |
+
| .phaseT i => .phaseT (f (qmaQubit sourceWork i)).val
|
| 15 |
+
| .controlledNot i j =>
|
| 16 |
+
.controlledNot (f (qmaQubit sourceWork i)).val (f (qmaQubit sourceWork j)).val
|
| 17 |
+
|
| 18 |
+
theorem qmaMapGate_wellFormed (sourceWork targetWork : ℕ)
|
| 19 |
+
(f : Fin (sourceWork+1) → Fin (targetWork+1)) (hf : Function.Injective f)
|
| 20 |
+
(g : QMAGate) (hg : g.WellFormed (sourceWork+1)) :
|
| 21 |
+
(qmaMapGate sourceWork targetWork f g).WellFormed (targetWork+1) := by
|
| 22 |
+
cases g with
|
| 23 |
+
| hadamard i => exact (f (qmaQubit sourceWork i)).isLt
|
| 24 |
+
| phaseT i => exact (f (qmaQubit sourceWork i)).isLt
|
| 25 |
+
| controlledNot i j =>
|
| 26 |
+
refine ⟨(f (qmaQubit sourceWork i)).isLt,(f (qmaQubit sourceWork j)).isLt,?_⟩
|
| 27 |
+
intro he
|
| 28 |
+
have h := congrArg Fin.val (hf (Fin.ext he))
|
| 29 |
+
simp only [qmaQubit,Nat.mod_eq_of_lt hg.1,Nat.mod_eq_of_lt hg.2.1] at h
|
| 30 |
+
exact hg.2.2 h
|
| 31 |
+
|
| 32 |
+
theorem qmaRelabelGate_map (sourceWork targetWork : ℕ)
|
| 33 |
+
(f : Fin (sourceWork+1) → Fin (targetWork+1))
|
| 34 |
+
(σ : Equiv.Perm (Fin (targetWork+1))) (g : QMAGate) :
|
| 35 |
+
qmaRelabelGate targetWork σ (qmaMapGate sourceWork targetWork f g) =
|
| 36 |
+
qmaMapGate sourceWork targetWork (σ ∘ f) g := by
|
| 37 |
+
cases g <;> simp only [qmaMapGate,qmaRelabelGate,qmaQubit_fin,Function.comp_apply]
|
| 38 |
+
|
| 39 |
+
theorem qmaMapGate_congr (sourceWork targetWork : ℕ)
|
| 40 |
+
(f h : Fin (sourceWork+1) → Fin (targetWork+1)) (he : ∀ i, f i = h i) (g : QMAGate) :
|
| 41 |
+
qmaMapGate sourceWork targetWork f g = qmaMapGate sourceWork targetWork h g := by
|
| 42 |
+
have hf : f = h := funext he
|
| 43 |
+
rw [hf]
|
| 44 |
+
|
| 45 |
+
end ContinuumCoulomb
|
| 46 |
+
|
| 47 |
+
end
|
| 48 |
+
|
| 49 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMask.lean
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAncilla
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Coordinate projections for the initial and output penalties. -/
|
| 6 |
+
|
| 7 |
+
noncomputable section
|
| 8 |
+
namespace ContinuumCoulomb
|
| 9 |
+
open scoped BigOperators Classical
|
| 10 |
+
|
| 11 |
+
def qmaMask {n : ℕ} (p : SourceSpinBasis n → Prop) :
|
| 12 |
+
EuclideanSpace ℂ (SourceSpinBasis n) →ₗ[ℂ] EuclideanSpace ℂ (SourceSpinBasis n) := by
|
| 13 |
+
classical
|
| 14 |
+
exact {
|
| 15 |
+
toFun := fun u => WithLp.toLp 2 (fun s => if p s then u s else 0)
|
| 16 |
+
map_add' := by intro u v; ext s; by_cases hs : p s <;> simp [hs]
|
| 17 |
+
map_smul' := by intro a u; ext s; by_cases hs : p s <;> simp [hs] }
|
| 18 |
+
|
| 19 |
+
@[simp] theorem qmaMask_apply {n : ℕ} (p : SourceSpinBasis n → Prop)
|
| 20 |
+
(u : EuclideanSpace ℂ (SourceSpinBasis n)) (s : SourceSpinBasis n) :
|
| 21 |
+
qmaMask p u s = if p s then u s else 0 := rfl
|
| 22 |
+
|
| 23 |
+
theorem qmaMask_norm_le {n : ℕ} (p : SourceSpinBasis n → Prop)
|
| 24 |
+
(u : EuclideanSpace ℂ (SourceSpinBasis n)) : ‖qmaMask p u‖ ≤ ‖u‖ := by
|
| 25 |
+
classical
|
| 26 |
+
apply (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mp
|
| 27 |
+
rw [EuclideanSpace.norm_sq_eq,EuclideanSpace.norm_sq_eq]
|
| 28 |
+
apply Finset.sum_le_sum
|
| 29 |
+
intro s _
|
| 30 |
+
by_cases hs : p s <;> simp [qmaMask_apply,hs]
|
| 31 |
+
|
| 32 |
+
theorem qmaMask_complement_square {n : ℕ} (p : SourceSpinBasis n → Prop)
|
| 33 |
+
(u : EuclideanSpace ℂ (SourceSpinBasis n)) :
|
| 34 |
+
‖qmaMask p u‖^2+‖qmaMask (fun s => ¬p s) u‖^2 = ‖u‖^2 := by
|
| 35 |
+
classical
|
| 36 |
+
simp only [EuclideanSpace.norm_sq_eq,←Finset.sum_add_distrib]
|
| 37 |
+
apply Finset.sum_congr rfl
|
| 38 |
+
intro s _
|
| 39 |
+
by_cases hs : p s <;> simp [hs]
|
| 40 |
+
|
| 41 |
+
theorem qmaMask_sub_norm_le {n : ℕ} (p : SourceSpinBasis n → Prop)
|
| 42 |
+
(u v : EuclideanSpace ℂ (SourceSpinBasis n)) :
|
| 43 |
+
‖qmaMask p u-qmaMask p v‖ ≤ ‖u-v‖ := by
|
| 44 |
+
rw [←map_sub]
|
| 45 |
+
exact qmaMask_norm_le p (u-v)
|
| 46 |
+
|
| 47 |
+
theorem qmaMask_square_difference {n : ℕ} (p : SourceSpinBasis n → Prop)
|
| 48 |
+
(u v : EuclideanSpace ℂ (SourceSpinBasis n)) :
|
| 49 |
+
|‖qmaMask p u‖^2-‖qmaMask p v‖^2| ≤ (‖u‖+‖v‖)*‖u-v‖ := by
|
| 50 |
+
rw [sq_sub_sq,abs_mul,abs_of_nonneg (add_nonneg (norm_nonneg _) (norm_nonneg _))]
|
| 51 |
+
have ha := (abs_norm_sub_norm_le (qmaMask p u) (qmaMask p v)).trans (qmaMask_sub_norm_le p u v)
|
| 52 |
+
have hb := add_le_add (qmaMask_norm_le p u) (qmaMask_norm_le p v)
|
| 53 |
+
exact mul_le_mul hb ha (abs_nonneg _) (by positivity)
|
| 54 |
+
|
| 55 |
+
theorem qmaMask_sub_self {n : ℕ} (p : SourceSpinBasis n → Prop)
|
| 56 |
+
(u : EuclideanSpace ℂ (SourceSpinBasis n)) :
|
| 57 |
+
u-qmaMask p u = qmaMask (fun s => ¬p s) u := by
|
| 58 |
+
ext s
|
| 59 |
+
by_cases hs : p s <;> simp [hs]
|
| 60 |
+
|
| 61 |
+
end ContinuumCoulomb
|
| 62 |
+
|
| 63 |
+
end
|
| 64 |
+
|
| 65 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMatrixError.lean
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalCore
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Entrywise errors of the bounded-size local matrices give quadratic
|
| 6 |
+
bounds that can be summed before any spectral approximation. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
open Matrix
|
| 11 |
+
open scoped BigOperators Classical
|
| 12 |
+
|
| 13 |
+
theorem qmaQuadratic_entry_bound {ι : Type*} [Fintype ι]
|
| 14 |
+
(A : Matrix ι ι ℂ) (B : ℝ) (hB : 0 ≤ B) (hA : ∀ i j, ‖A i j‖ ≤ B)
|
| 15 |
+
(u : ι → ℂ) :
|
| 16 |
+
|qmaQuadratic A u| ≤ (Fintype.card ι:ℝ)*B*(∑ i, ‖u i‖^2) := by
|
| 17 |
+
have he : qmaQuadratic A u = (∑ i, ∑ j, star (u i)*(A i j*u j)).re := by
|
| 18 |
+
simp [qmaQuadratic,Matrix.mulVec,dotProduct,Finset.mul_sum]
|
| 19 |
+
rw [he]
|
| 20 |
+
calc
|
| 21 |
+
_ ≤ ‖∑ i, ∑ j, star (u i)*(A i j*u j)‖ := Complex.abs_re_le_norm _
|
| 22 |
+
_ ≤ ∑ i, ∑ j, ‖star (u i)*(A i j*u j)‖ := by
|
| 23 |
+
apply (norm_sum_le _ _).trans
|
| 24 |
+
apply Finset.sum_le_sum
|
| 25 |
+
intro i _
|
| 26 |
+
exact norm_sum_le _ _
|
| 27 |
+
_ ≤ ∑ i, ∑ j, ‖u i‖*B*‖u j‖ := by
|
| 28 |
+
apply Finset.sum_le_sum
|
| 29 |
+
intro i _
|
| 30 |
+
apply Finset.sum_le_sum
|
| 31 |
+
intro j _
|
| 32 |
+
simp only [norm_mul,norm_star]
|
| 33 |
+
calc
|
| 34 |
+
_ ≤ ‖u i‖*(B*‖u j‖) := mul_le_mul_of_nonneg_left
|
| 35 |
+
(mul_le_mul_of_nonneg_right (hA i j) (norm_nonneg _)) (norm_nonneg _)
|
| 36 |
+
_ = _ := by ring
|
| 37 |
+
_ ≤ ∑ i, ∑ j, (B/2)*(‖u i‖^2+‖u j‖^2) := by
|
| 38 |
+
apply Finset.sum_le_sum
|
| 39 |
+
intro i _
|
| 40 |
+
apply Finset.sum_le_sum
|
| 41 |
+
intro j _
|
| 42 |
+
have h := mul_nonneg hB (sq_nonneg (‖u i‖-‖u j‖))
|
| 43 |
+
nlinarith
|
| 44 |
+
_ = _ := by
|
| 45 |
+
simp only [mul_add,Finset.sum_add_distrib,←Finset.mul_sum,Finset.sum_const,
|
| 46 |
+
nsmul_eq_mul,Finset.card_univ]
|
| 47 |
+
ring
|
| 48 |
+
|
| 49 |
+
end ContinuumCoulomb
|
| 50 |
+
|
| 51 |
+
end
|
| 52 |
+
|
| 53 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMediatorGeometry.lean
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialModel
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumLocalSupported
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Placing a mediator at its source term's anchor preserves the spatial support bound. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
open scoped Classical
|
| 11 |
+
variable {ι κ : Type*} [DecidableEq ι] [DecidableEq κ]
|
| 12 |
+
|
| 13 |
+
omit [DecidableEq ι] [DecidableEq κ] in
|
| 14 |
+
def qmaMediatorCell {rows width : ℕ} (cell : ι → QMAGridCell rows width)
|
| 15 |
+
(anchor : κ → QMAGridCell rows width) : ι ⊕ κ → QMAGridCell rows width :=
|
| 16 |
+
Sum.elim cell anchor
|
| 17 |
+
|
| 18 |
+
theorem qmaMediatorSupport_geometry {rows width : ℕ} (cell : ι → QMAGridCell rows width)
|
| 19 |
+
(anchor : κ → QMAGridCell rows width) (S : Finset ι) (e : κ)
|
| 20 |
+
(hS : ∀ i ∈ S, QMAGridCellsNear (cell i) (anchor e))
|
| 21 |
+
(q : ι ⊕ κ) (hq : q ∈ qmaMediatorSupport S e) :
|
| 22 |
+
QMAGridCellsNear (qmaMediatorCell cell anchor q) (anchor e) := by
|
| 23 |
+
cases q with
|
| 24 |
+
| inl i =>
|
| 25 |
+
apply hS
|
| 26 |
+
simpa [qmaMediatorSupport] using hq
|
| 27 |
+
| inr j =>
|
| 28 |
+
have he : j = e := by simpa [qmaMediatorSupport] using hq
|
| 29 |
+
subst j
|
| 30 |
+
exact qmaGridCellsNear_refl _
|
| 31 |
+
|
| 32 |
+
end ContinuumCoulomb
|
| 33 |
+
|
| 34 |
+
end
|
| 35 |
+
|
| 36 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMergeEdges.lean
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRationalPathStep
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Parallel interactions are combined at one canonically ordered physical edge.
|
| 6 |
+
This is an exact matrix operation, with no perturbative error. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
open scoped BigOperators Classical
|
| 11 |
+
namespace QMARationalExchangeGraph
|
| 12 |
+
|
| 13 |
+
def orderedPair (G : QMARationalExchangeGraph) (e : G.Edge) : Fin G.n × Fin G.n :=
|
| 14 |
+
(min (G.left e) (G.right e),max (G.left e) (G.right e))
|
| 15 |
+
|
| 16 |
+
def edgePairs (G : QMARationalExchangeGraph) : Finset (Fin G.n × Fin G.n) :=
|
| 17 |
+
Finset.univ.image G.orderedPair
|
| 18 |
+
|
| 19 |
+
abbrev MergedEdge (G : QMARationalExchangeGraph) := {p // p ∈ G.edgePairs}
|
| 20 |
+
|
| 21 |
+
def edgeClass (G : QMARationalExchangeGraph) (e : G.Edge) : G.MergedEdge :=
|
| 22 |
+
⟨G.orderedPair e,Finset.mem_image.mpr ⟨e,Finset.mem_univ _,rfl⟩⟩
|
| 23 |
+
|
| 24 |
+
theorem orderedPair_lt (G : QMARationalExchangeGraph) (e : G.Edge) :
|
| 25 |
+
(G.orderedPair e).1 < (G.orderedPair e).2 := by
|
| 26 |
+
rcases lt_or_gt_of_ne (G.distinct e) with h | h
|
| 27 |
+
· simpa only [orderedPair,min_eq_left h.le,max_eq_right h.le] using h
|
| 28 |
+
· simpa only [orderedPair,min_eq_right h.le,max_eq_left h.le] using h
|
| 29 |
+
|
| 30 |
+
theorem mergedEdge_lt (G : QMARationalExchangeGraph) (p : G.MergedEdge) : p.val.1 < p.val.2 := by
|
| 31 |
+
obtain ⟨e,_,he⟩ := Finset.mem_image.mp p.property
|
| 32 |
+
rw [← he]
|
| 33 |
+
exact G.orderedPair_lt e
|
| 34 |
+
|
| 35 |
+
theorem orderedPair_matrix (G : QMARationalExchangeGraph) (e : G.Edge) :
|
| 36 |
+
sourceHeisenbergMatrix G.n (G.orderedPair e).1 (G.orderedPair e).2 =
|
| 37 |
+
sourceHeisenbergMatrix G.n (G.left e) (G.right e) := by
|
| 38 |
+
rcases le_total (G.left e) (G.right e) with h | h
|
| 39 |
+
· simp only [orderedPair,min_eq_left h,max_eq_right h]
|
| 40 |
+
· simpa only [orderedPair,min_eq_right h,max_eq_left h] using
|
| 41 |
+
qmaHeisenberg_symm G.n (G.right e) (G.left e)
|
| 42 |
+
|
| 43 |
+
def merge (G : QMARationalExchangeGraph) : QMARationalExchangeGraph where
|
| 44 |
+
n := G.n
|
| 45 |
+
Edge := G.MergedEdge
|
| 46 |
+
left := fun p => p.val.1
|
| 47 |
+
right := fun p => p.val.2
|
| 48 |
+
distinct := fun p => (G.mergedEdge_lt p).ne
|
| 49 |
+
weight := fun p => ∑ e, if G.edgeClass e = p then G.weight e else 0
|
| 50 |
+
constant := G.constant
|
| 51 |
+
|
| 52 |
+
theorem merge_matrix (G : QMARationalExchangeGraph) :
|
| 53 |
+
qmaExchangeMatrix G.merge.left G.merge.right (fun e => (G.merge.weight e:ℝ)) G.merge.constant =
|
| 54 |
+
qmaExchangeMatrix G.left G.right (fun e => (G.weight e:ℝ)) G.constant := by
|
| 55 |
+
unfold qmaExchangeMatrix
|
| 56 |
+
congr 1
|
| 57 |
+
change (∑ p : G.MergedEdge,
|
| 58 |
+
(((∑ e, if G.edgeClass e = p then G.weight e else 0):ℚ):ℂ) •
|
| 59 |
+
sourceHeisenbergMatrix G.n p.val.1 p.val.2) = _
|
| 60 |
+
push_cast
|
| 61 |
+
simp only [Finset.sum_smul]
|
| 62 |
+
rw [Finset.sum_comm]
|
| 63 |
+
apply Finset.sum_congr rfl
|
| 64 |
+
intro e _
|
| 65 |
+
have hcast (p : G.MergedEdge) : (((if G.edgeClass e = p then G.weight e else 0):ℚ):ℂ) =
|
| 66 |
+
(if G.edgeClass e = p then (G.weight e:ℂ) else 0) := by split_ifs <;> simp
|
| 67 |
+
simp_rw [hcast,ite_smul,zero_smul]
|
| 68 |
+
rw [Finset.sum_ite_eq]
|
| 69 |
+
simp only [Finset.mem_univ,ite_true]
|
| 70 |
+
rw [show (G.edgeClass e).val = G.orderedPair e from rfl,G.orderedPair_matrix]
|
| 71 |
+
|
| 72 |
+
theorem merge_energy (G : QMARationalExchangeGraph) : G.merge.energy = G.energy := by
|
| 73 |
+
unfold energy
|
| 74 |
+
rw [G.merge_matrix]
|
| 75 |
+
rfl
|
| 76 |
+
|
| 77 |
+
theorem merge_pair_injective (G : QMARationalExchangeGraph) :
|
| 78 |
+
Function.Injective (fun e : G.merge.Edge => (G.merge.left e,G.merge.right e)) := by
|
| 79 |
+
intro e f h
|
| 80 |
+
exact Subtype.ext h
|
| 81 |
+
|
| 82 |
+
theorem merge_edge_count (G : QMARationalExchangeGraph) : Fintype.card G.merge.Edge ≤ Fintype.card G.Edge := by
|
| 83 |
+
change Fintype.card G.MergedEdge ≤ _
|
| 84 |
+
rw [Fintype.card_coe]
|
| 85 |
+
exact (Finset.card_image_le).trans_eq (Finset.card_univ)
|
| 86 |
+
|
| 87 |
+
theorem merge_edge_source (G : QMARationalExchangeGraph) (p : G.merge.Edge) :
|
| 88 |
+
∃ e : G.Edge, (G.merge.left p = G.left e ∧ G.merge.right p = G.right e) ∨
|
| 89 |
+
(G.merge.left p = G.right e ∧ G.merge.right p = G.left e) := by
|
| 90 |
+
obtain ⟨e,_,he⟩ := Finset.mem_image.mp p.property
|
| 91 |
+
refine ⟨e,?_⟩
|
| 92 |
+
change (p.val.1 = G.left e ∧ p.val.2 = G.right e) ∨
|
| 93 |
+
(p.val.1 = G.right e ∧ p.val.2 = G.left e)
|
| 94 |
+
rw [← he]
|
| 95 |
+
rcases le_total (G.left e) (G.right e) with h | h
|
| 96 |
+
· exact Or.inl ⟨min_eq_left h,max_eq_right h⟩
|
| 97 |
+
· exact Or.inr ⟨min_eq_right h,max_eq_left h⟩
|
| 98 |
+
|
| 99 |
+
end QMARationalExchangeGraph
|
| 100 |
+
end ContinuumCoulomb
|
| 101 |
+
|
| 102 |
+
end
|
| 103 |
+
|
| 104 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMergedCoefficientBounds.lean
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingPacketBounds
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumPlanarTapeSupport
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Merging the actual bond tape reduces its length and increases each
|
| 7 |
+
coefficient by at most the input length. These bounds apply directly to the
|
| 8 |
+
numeric graph used by the final route compiler. -/
|
| 9 |
+
|
| 10 |
+
noncomputable section
|
| 11 |
+
namespace ContinuumCoulomb.QuantumListMerge
|
| 12 |
+
open MediatorListProgram
|
| 13 |
+
|
| 14 |
+
theorem value_length_le_input (n : ℕ) (xs : List Bond) :
|
| 15 |
+
(value n xs).length ≤ xs.length := by
|
| 16 |
+
have hs : support n xs ⊆ xs.map ordered := by
|
| 17 |
+
intro p hp
|
| 18 |
+
exact of_decide_eq_true (List.mem_filter.mp hp).2
|
| 19 |
+
have h := (support_nodup n xs).length_le_of_subset hs
|
| 20 |
+
simpa only [value,List.length_map] using h
|
| 21 |
+
|
| 22 |
+
theorem value_coefficient_bound (n : ℕ) (xs : List Bond) {L : ℝ}
|
| 23 |
+
(hL : 0 ≤ L) (hw : ∀ e ∈ xs, |(e.2.2 : ℝ)| ≤ L) :
|
| 24 |
+
∀ e ∈ value n xs, |(e.2.2 : ℝ)| ≤ xs.length*L := by
|
| 25 |
+
intro e he
|
| 26 |
+
obtain ⟨p,_,rfl⟩ := List.mem_map.mp he
|
| 27 |
+
exact weight_abs_le xs p hL hw
|
| 28 |
+
|
| 29 |
+
end ContinuumCoulomb.QuantumListMerge
|
| 30 |
+
|
| 31 |
+
namespace ContinuumCoulomb.QuantumPlanarTapeGeometry
|
| 32 |
+
open QuantumPlanarTapeProgram
|
| 33 |
+
open scoped Classical
|
| 34 |
+
|
| 35 |
+
theorem graph_count (x : Input) (hn : ∀ e ∈ x.1.1.2.1, e.1 ≠ e.2.1) :
|
| 36 |
+
Fintype.card (graph x hn).Edge ≤ x.1.1.2.1.length := by
|
| 37 |
+
change Fintype.card (Fin (merged x).length) ≤ _
|
| 38 |
+
rw [Fintype.card_fin]
|
| 39 |
+
exact QuantumListMerge.value_length_le_input _ _
|
| 40 |
+
|
| 41 |
+
theorem graph_coefficientBound (x : Input)
|
| 42 |
+
(hn : ∀ e ∈ x.1.1.2.1, e.1 ≠ e.2.1) {m L : ℝ}
|
| 43 |
+
(hm : (x.1.1.2.1.length : ℝ) ≤ m) (hL : 0 ≤ L)
|
| 44 |
+
(hc : |(x.1.1.2.2 : ℝ)| ≤ L)
|
| 45 |
+
(hw : ∀ e ∈ x.1.1.2.1, |(e.2.2 : ℝ)| ≤ L) :
|
| 46 |
+
(graph x hn).CoefficientBound ((m+1)*L) := by
|
| 47 |
+
have hm0 : 0 ≤ m := (Nat.cast_nonneg _).trans hm
|
| 48 |
+
constructor
|
| 49 |
+
· change |(x.1.1.2.2 : ℝ)| ≤ _
|
| 50 |
+
nlinarith
|
| 51 |
+
· intro e
|
| 52 |
+
have h := QuantumListMerge.value_coefficient_bound x.1.1.1 x.1.1.2.1 hL hw
|
| 53 |
+
_ (List.get_mem (merged x) e)
|
| 54 |
+
change |(((merged x).get e).2.2 : ℝ)| ≤ _
|
| 55 |
+
exact h.trans ((mul_le_mul_of_nonneg_right hm hL).trans (by nlinarith))
|
| 56 |
+
|
| 57 |
+
theorem graph_coefficientBound_of_raw (x : Input)
|
| 58 |
+
(hb : SourceBondLists.bounded x.1.1.1 x.1.1.2.1)
|
| 59 |
+
(hn : ∀ e ∈ x.1.1.2.1, e.1 ≠ e.2.1) {m L : ℝ}
|
| 60 |
+
(hm : (Fintype.card (rawGraph x hb hn).Edge : ℝ) ≤ m) (hL : 0 ≤ L)
|
| 61 |
+
(hc : (rawGraph x hb hn).CoefficientBound L) :
|
| 62 |
+
(graph x hn).CoefficientBound ((m+1)*L) := by
|
| 63 |
+
have hlen : (x.1.1.2.1.length : ℝ) ≤ m := by
|
| 64 |
+
change (Fintype.card (Fin x.1.1.2.1.length) : ℝ) ≤ m at hm
|
| 65 |
+
simpa only [Fintype.card_fin] using hm
|
| 66 |
+
apply graph_coefficientBound x hn hlen hL hc.1
|
| 67 |
+
intro e he
|
| 68 |
+
obtain ⟨i,rfl⟩ := List.mem_iff_get.mp he
|
| 69 |
+
exact hc.2 i
|
| 70 |
+
|
| 71 |
+
end ContinuumCoulomb.QuantumPlanarTapeGeometry
|
| 72 |
+
|
| 73 |
+
namespace ContinuumCoulomb.QuantumCrossingSelectProgram
|
| 74 |
+
open QuantumPlanarTapeProgram
|
| 75 |
+
open scoped Classical
|
| 76 |
+
|
| 77 |
+
variable {G : QMARationalExchangeGraph} {r k : ℕ}
|
| 78 |
+
(S : QMARationalCrossingSelection G r) (labels : G.Edge ≃ Fin k)
|
| 79 |
+
|
| 80 |
+
theorem compiled_planar_bounds {N : ℚ} (hN : 0 ≤ N) {m L T : ℝ}
|
| 81 |
+
(hm : (Fintype.card G.Edge : ℝ) ≤ m) (hL : 1 ≤ L) (hT : |(N : ℝ)| ≤ T)
|
| 82 |
+
(hc : G.CoefficientBound L) (x : QuantumPlanarTapeProgram.Input)
|
| 83 |
+
(hx : x.1.1 = QuantumCrossingListLayer.value
|
| 84 |
+
(QuantumCrossingListLayer.actualInput (computedLayer S labels) N (Equiv.refl _)))
|
| 85 |
+
(hn : ∀ e ∈ x.1.1.2.1, e.1 ≠ e.2.1) :
|
| 86 |
+
(QuantumPlanarTapeGeometry.graph x hn).CoefficientBound
|
| 87 |
+
((m+9*r+1)*qmaCrossingCoefficientBound m r ((m+1)*L) T) ∧
|
| 88 |
+
(Fintype.card (QuantumPlanarTapeGeometry.graph x hn).Edge : ℝ) ≤ m+9*r := by
|
| 89 |
+
let E := qmaCrossingCoefficientBound m r ((m+1)*L) T
|
| 90 |
+
have hm0 : 0 ≤ m := (Nat.cast_nonneg _).trans hm
|
| 91 |
+
have hL0 : 0 ≤ L := by linarith
|
| 92 |
+
have hE : 0 ≤ E := by
|
| 93 |
+
dsimp [E,qmaCrossingCoefficientBound]
|
| 94 |
+
positivity
|
| 95 |
+
have hout := computedLayer_output_coefficientBound S labels hN hm hL hT hc
|
| 96 |
+
have hlen : (x.1.1.2.1.length : ℝ) ≤ m+9*r := by
|
| 97 |
+
rw [hx]
|
| 98 |
+
change ((QuantumCrossingListLayer.bonds
|
| 99 |
+
(QuantumCrossingListLayer.actualInput (computedLayer S labels) N (Equiv.refl _))).length : ℝ)
|
| 100 |
+
≤ m+9*r
|
| 101 |
+
have h := compiled_graph_count S labels hm N
|
| 102 |
+
change (Fintype.card (Fin (QuantumCrossingListLayer.bonds
|
| 103 |
+
(QuantumCrossingListLayer.actualInput (computedLayer S labels) N (Equiv.refl _))).length) : ℝ)
|
| 104 |
+
≤ m+9*r at h
|
| 105 |
+
simpa only [Fintype.card_fin] using h
|
| 106 |
+
constructor
|
| 107 |
+
· apply QuantumPlanarTapeGeometry.graph_coefficientBound x hn hlen hE
|
| 108 |
+
· rw [hx]
|
| 109 |
+
change |(QuantumCrossingListLayer.constant
|
| 110 |
+
(QuantumCrossingListLayer.actualInput (computedLayer S labels) N (Equiv.refl _)) : ℝ)| ≤ E
|
| 111 |
+
rw [QuantumCrossingListLayer.constant_actual (computedLayer S labels) N (Equiv.refl _)]
|
| 112 |
+
exact hout.1
|
| 113 |
+
· intro e he
|
| 114 |
+
rw [hx] at he
|
| 115 |
+
exact QuantumCrossingListLayer.actual_bonds_coefficientBound _ _ _ hout e he
|
| 116 |
+
· have h : (Fintype.card (QuantumPlanarTapeGeometry.graph x hn).Edge : ℝ) ≤
|
| 117 |
+
(x.1.1.2.1.length : ℝ) := by
|
| 118 |
+
exact_mod_cast QuantumPlanarTapeGeometry.graph_count x hn
|
| 119 |
+
exact h.trans hlen
|
| 120 |
+
|
| 121 |
+
theorem compiled_planar_nat {N : ℚ} (hN : 0 ≤ N) {m L T : ℕ}
|
| 122 |
+
(hm : Fintype.card G.Edge ≤ m) (hL : 1 ≤ L) (hT : |(N : ℝ)| ≤ T)
|
| 123 |
+
(hc : G.CoefficientBound L) (x : QuantumPlanarTapeProgram.Input)
|
| 124 |
+
(hx : x.1.1 = QuantumCrossingListLayer.value
|
| 125 |
+
(QuantumCrossingListLayer.actualInput (computedLayer S labels) N (Equiv.refl _)))
|
| 126 |
+
(hn : ∀ e ∈ x.1.1.2.1, e.1 ≠ e.2.1) :
|
| 127 |
+
(QuantumPlanarTapeGeometry.graph x hn).CoefficientBound
|
| 128 |
+
((m+9*r+1)*QuantumCoefficientPrograms.crossingCoefficient m r ((m+1)*L) T) ∧
|
| 129 |
+
Fintype.card (QuantumPlanarTapeGeometry.graph x hn).Edge ≤ m+9*r := by
|
| 130 |
+
have hm' : (Fintype.card G.Edge : ℝ) ≤ m := by exact_mod_cast hm
|
| 131 |
+
have hL' : (1 : ℝ) ≤ L := by exact_mod_cast hL
|
| 132 |
+
have h := compiled_planar_bounds S labels hN hm' hL' hT hc x hx hn
|
| 133 |
+
constructor
|
| 134 |
+
· simpa only [Nat.cast_mul,Nat.cast_add,Nat.cast_one,Nat.cast_ofNat,
|
| 135 |
+
QuantumCoefficientPrograms.crossingCoefficient_cast] using h.1
|
| 136 |
+
· exact_mod_cast h.2
|
| 137 |
+
|
| 138 |
+
end ContinuumCoulomb.QuantumCrossingSelectProgram
|
| 139 |
+
|
| 140 |
+
end
|
| 141 |
+
|
| 142 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMergedEndpointPairs.lean
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMergedOutputRoutes
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Distinct merged interactions have different unordered physical endpoints. -/
|
| 6 |
+
|
| 7 |
+
noncomputable section
|
| 8 |
+
namespace ContinuumCoulomb
|
| 9 |
+
open scoped Classical
|
| 10 |
+
|
| 11 |
+
theorem qmaMergedEndpointPairs_injective (G : QMARationalExchangeGraph)
|
| 12 |
+
(position : Fin G.n → ℕ × ℕ) (hp : Function.Injective position) :
|
| 13 |
+
Function.Injective (fun e : G.merge.Edge => s(position (G.merge.left e),position (G.merge.right e))) := by
|
| 14 |
+
intro e f h
|
| 15 |
+
rcases Sym2.eq_iff.mp h with ⟨hl,hr⟩ | ⟨hl,hr⟩
|
| 16 |
+
· exact G.merge_pair_injective (Prod.ext (hp hl) (hp hr))
|
| 17 |
+
· have hleft := hp hl
|
| 18 |
+
have hright := hp hr
|
| 19 |
+
have he := G.mergedEdge_lt e
|
| 20 |
+
have hf := G.mergedEdge_lt f
|
| 21 |
+
change G.merge.left e < G.merge.right e at he
|
| 22 |
+
change G.merge.left f < G.merge.right f at hf
|
| 23 |
+
rw [hleft,hright] at he
|
| 24 |
+
exact (lt_asymm he hf).elim
|
| 25 |
+
|
| 26 |
+
namespace QMACellRoute
|
| 27 |
+
|
| 28 |
+
def endpointPair (R : QMACellRoute) : Sym2 (ℕ × ℕ) := s(R.source,R.target)
|
| 29 |
+
|
| 30 |
+
theorem endpointPair_body (R : QMACellRoute) : R.endpointPair = s(R.body.source,R.body.target) := by
|
| 31 |
+
rcases R with ⟨b,r⟩
|
| 32 |
+
cases r
|
| 33 |
+
· rfl
|
| 34 |
+
· exact Sym2.eq_swap
|
| 35 |
+
|
| 36 |
+
end QMACellRoute
|
| 37 |
+
namespace QMAPortRouteData
|
| 38 |
+
variable {G : QMARationalExchangeGraph} (P : QMAPortRouteData G)
|
| 39 |
+
|
| 40 |
+
theorem mergedOutputRoute_pairs_injective (N : ℚ) {D : ℕ} (hD : ∀ e, P.length e ≤ D)
|
| 41 |
+
(havoid : ∀ i : P.Interior, ∀ v, P.cell i ≠ P.position v) :
|
| 42 |
+
Function.Injective (fun e => (P.mergedOutputRoute N hD havoid e).endpointPair) := by
|
| 43 |
+
intro e f h
|
| 44 |
+
apply qmaMergedEndpointPairs_injective (P.crossingOutput N hD)
|
| 45 |
+
(P.crossingPosition N D) (P.crossingPosition_injective N D)
|
| 46 |
+
have he := P.mergedOutputRoute_spec N hD havoid e
|
| 47 |
+
have hf := P.mergedOutputRoute_spec N hD havoid f
|
| 48 |
+
simpa only [QMACellRoute.endpointPair,he.2.2.1,he.2.2.2,hf.2.2.1,hf.2.2.2] using h
|
| 49 |
+
|
| 50 |
+
end QMAPortRouteData
|
| 51 |
+
end ContinuumCoulomb
|
| 52 |
+
|
| 53 |
+
end
|
| 54 |
+
|
| 55 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMergedOutputRoutes.lean
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCrossingOutputRoutes
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMergeEdges
|
| 3 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRouteEnumeration
|
| 4 |
+
|
| 5 |
+
namespace OAI
|
| 6 |
+
|
| 7 |
+
/-! Exact parallel-edge merging preserves the physical placement and reverses
|
| 8 |
+
the catalog route when canonical endpoint ordering requires it. -/
|
| 9 |
+
|
| 10 |
+
noncomputable section
|
| 11 |
+
namespace ContinuumCoulomb
|
| 12 |
+
open scoped Classical
|
| 13 |
+
namespace QMACellRoute
|
| 14 |
+
|
| 15 |
+
def reverse (R : QMACellRoute) : QMACellRoute := ⟨R.body,!R.reversed⟩
|
| 16 |
+
|
| 17 |
+
@[simp] theorem reverse_body (R : QMACellRoute) : R.reverse.body = R.body := rfl
|
| 18 |
+
|
| 19 |
+
@[simp] theorem reverse_source (R : QMACellRoute) : R.reverse.source = R.target := by
|
| 20 |
+
rcases R with ⟨b,r⟩
|
| 21 |
+
cases r <;> rfl
|
| 22 |
+
|
| 23 |
+
@[simp] theorem reverse_target (R : QMACellRoute) : R.reverse.target = R.source := by
|
| 24 |
+
rcases R with ⟨b,r⟩
|
| 25 |
+
cases r <;> rfl
|
| 26 |
+
|
| 27 |
+
@[simp] theorem reverse_valid (R : QMACellRoute) : R.reverse.Valid = R.Valid := rfl
|
| 28 |
+
|
| 29 |
+
end QMACellRoute
|
| 30 |
+
namespace QMAPortRouteData
|
| 31 |
+
variable {G : QMARationalExchangeGraph} (P : QMAPortRouteData G)
|
| 32 |
+
|
| 33 |
+
theorem mergedOutput_route_exists (N : ℚ) {D : ℕ} (hD : ∀ e, P.length e ≤ D)
|
| 34 |
+
(havoid : ∀ i : P.Interior, ∀ v, P.cell i ≠ P.position v)
|
| 35 |
+
(e : (P.crossingOutput N hD).merge.Edge) :
|
| 36 |
+
∃ R : QMACellRoute, P.RoutingAllowed R.body ∧ R.Valid ∧
|
| 37 |
+
R.source = P.crossingPosition N D ((P.crossingOutput N hD).merge.left e) ∧
|
| 38 |
+
R.target = P.crossingPosition N D ((P.crossingOutput N hD).merge.right e) := by
|
| 39 |
+
obtain ⟨f,hf⟩ := (P.crossingOutput N hD).merge_edge_source e
|
| 40 |
+
obtain ⟨R,hR,hv,hl,hr⟩ := P.crossingOutput_route_exists N hD havoid f
|
| 41 |
+
rcases hf with ⟨hleft,hright⟩ | ⟨hleft,hright⟩
|
| 42 |
+
· exact ⟨R,hR,hv,hl.trans (congrArg (P.crossingPosition N D) hleft.symm),
|
| 43 |
+
hr.trans (congrArg (P.crossingPosition N D) hright.symm)⟩
|
| 44 |
+
· refine ⟨R.reverse,hR,hv,?_,?_⟩
|
| 45 |
+
· exact R.reverse_source.trans (hr.trans (congrArg (P.crossingPosition N D) hleft.symm))
|
| 46 |
+
· exact R.reverse_target.trans (hl.trans (congrArg (P.crossingPosition N D) hright.symm))
|
| 47 |
+
|
| 48 |
+
def findMergedRoute (N : ℚ) {D : ℕ} (hD : ∀ e, P.length e ≤ D)
|
| 49 |
+
(e : (P.crossingOutput N hD).merge.Edge) : Option QMACellRoute :=
|
| 50 |
+
(qmaRouteCandidates
|
| 51 |
+
(P.crossingPosition N D ((P.crossingOutput N hD).merge.left e))
|
| 52 |
+
(P.crossingPosition N D ((P.crossingOutput N hD).merge.right e))).find? (fun R =>
|
| 53 |
+
decide (P.RoutingAllowed R.body ∧ R.Valid ∧
|
| 54 |
+
R.source = P.crossingPosition N D ((P.crossingOutput N hD).merge.left e) ∧
|
| 55 |
+
R.target = P.crossingPosition N D ((P.crossingOutput N hD).merge.right e)))
|
| 56 |
+
|
| 57 |
+
theorem findMergedRoute_isSome (N : ℚ) {D : ℕ} (hD : ∀ e, P.length e ≤ D)
|
| 58 |
+
(havoid : ∀ i : P.Interior, ∀ v, P.cell i ≠ P.position v)
|
| 59 |
+
(e : (P.crossingOutput N hD).merge.Edge) : (P.findMergedRoute N hD e).isSome := by
|
| 60 |
+
obtain ⟨R,hR,hvalid,hs,ht⟩ := P.mergedOutput_route_exists N hD havoid e
|
| 61 |
+
apply List.find?_isSome.mpr
|
| 62 |
+
refine ⟨R,?_,?_⟩
|
| 63 |
+
· simpa only [hs,ht] using qmaRouteCandidates_complete R
|
| 64 |
+
· exact decide_eq_true ⟨hR,hvalid,hs,ht⟩
|
| 65 |
+
|
| 66 |
+
theorem findMergedRoute_spec (N : ℚ) {D : ℕ} (hD : ∀ e, P.length e ≤ D)
|
| 67 |
+
(e : (P.crossingOutput N hD).merge.Edge) {R : QMACellRoute}
|
| 68 |
+
(h : P.findMergedRoute N hD e = some R) :
|
| 69 |
+
P.RoutingAllowed R.body ∧ R.Valid ∧
|
| 70 |
+
R.source = P.crossingPosition N D ((P.crossingOutput N hD).merge.left e) ∧
|
| 71 |
+
R.target = P.crossingPosition N D ((P.crossingOutput N hD).merge.right e) := by
|
| 72 |
+
unfold findMergedRoute at h
|
| 73 |
+
have hp := List.find?_some h
|
| 74 |
+
exact of_decide_eq_true hp
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
def mergedOutputRoute (N : ℚ) {D : ℕ} (hD : ∀ e, P.length e ≤ D)
|
| 78 |
+
(havoid : ∀ i : P.Interior, ∀ v, P.cell i ≠ P.position v)
|
| 79 |
+
(e : (P.crossingOutput N hD).merge.Edge) : QMACellRoute :=
|
| 80 |
+
(P.findMergedRoute N hD e).get (P.findMergedRoute_isSome N hD havoid e)
|
| 81 |
+
|
| 82 |
+
theorem mergedOutputRoute_spec (N : ℚ) {D : ℕ} (hD : ∀ e, P.length e ≤ D)
|
| 83 |
+
(havoid : ∀ i : P.Interior, ∀ v, P.cell i ≠ P.position v)
|
| 84 |
+
(e : (P.crossingOutput N hD).merge.Edge) :
|
| 85 |
+
P.RoutingAllowed (P.mergedOutputRoute N hD havoid e).body ∧
|
| 86 |
+
(P.mergedOutputRoute N hD havoid e).Valid ∧
|
| 87 |
+
(P.mergedOutputRoute N hD havoid e).source =
|
| 88 |
+
P.crossingPosition N D ((P.crossingOutput N hD).merge.left e) ∧
|
| 89 |
+
(P.mergedOutputRoute N hD havoid e).target =
|
| 90 |
+
P.crossingPosition N D ((P.crossingOutput N hD).merge.right e) := by
|
| 91 |
+
apply P.findMergedRoute_spec N hD e
|
| 92 |
+
exact (Option.some_get (P.findMergedRoute_isSome N hD havoid e)).symm
|
| 93 |
+
|
| 94 |
+
theorem mergedOutput_energy_error {N : ℚ} (hN : 0 < N) {D : ℕ} (hD : ∀ e, P.length e ≤ D) :
|
| 95 |
+
|(P.crossingOutput N hD).merge.energy-G.energy| ≤ ((D+1:ℕ):ℝ)/(N:ℝ) := by
|
| 96 |
+
rw [QMARationalExchangeGraph.merge_energy]
|
| 97 |
+
exact P.portCrossing_energy_error hN hD
|
| 98 |
+
|
| 99 |
+
end QMAPortRouteData
|
| 100 |
+
end ContinuumCoulomb
|
| 101 |
+
|
| 102 |
+
end
|
| 103 |
+
|
| 104 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumMergedSupport.lean
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumListMergeProperties
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumMergeEdges
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Canonical merging preserves exactly the unordered endpoint support.
|
| 7 |
+
This includes edges whose merged coefficient is zero. -/
|
| 8 |
+
|
| 9 |
+
noncomputable section
|
| 10 |
+
namespace ContinuumCoulomb
|
| 11 |
+
open scoped Classical
|
| 12 |
+
|
| 13 |
+
theorem qmaUnorderedPair_map {α β : Type*} (f : α → β) {a b c d : α}
|
| 14 |
+
(h : s(a,b) = s(c,d)) : s(f a,f b) = s(f c,f d) := by
|
| 15 |
+
rcases Sym2.eq_iff.mp h with ⟨ha,hb⟩ | ⟨ha,hb⟩
|
| 16 |
+
· rw [ha,hb]
|
| 17 |
+
· rw [ha,hb]
|
| 18 |
+
exact Sym2.eq_swap
|
| 19 |
+
|
| 20 |
+
namespace QuantumListMerge
|
| 21 |
+
open MediatorListProgram
|
| 22 |
+
|
| 23 |
+
theorem ordered_endpointPair (e : Bond) :
|
| 24 |
+
s((ordered e).1,(ordered e).2) = s(e.1,e.2.1) := by
|
| 25 |
+
rcases le_total e.1 e.2.1 with h | h
|
| 26 |
+
· simp only [ordered,min_eq_left h,max_eq_right h]
|
| 27 |
+
· simpa only [ordered,min_eq_right h,max_eq_left h] using
|
| 28 |
+
(Sym2.eq_swap : s(e.2.1,e.1) = s(e.1,e.2.1))
|
| 29 |
+
|
| 30 |
+
theorem value_edge_source (n : ℕ) (xs : List Bond) {e : Bond}
|
| 31 |
+
(he : e ∈ value n xs) :
|
| 32 |
+
∃ f ∈ xs, s(e.1,e.2.1) = s(f.1,f.2.1) := by
|
| 33 |
+
obtain ⟨p,hp,rfl⟩ := List.mem_map.mp he
|
| 34 |
+
have hm := of_decide_eq_true (List.mem_filter.mp hp).2
|
| 35 |
+
obtain ⟨f,hf,hfp⟩ := List.mem_map.mp hm
|
| 36 |
+
refine ⟨f,hf,?_⟩
|
| 37 |
+
rw [← hfp]
|
| 38 |
+
exact ordered_endpointPair f
|
| 39 |
+
|
| 40 |
+
theorem value_edge_target {n : ℕ} {xs : List Bond}
|
| 41 |
+
(hb : SourceBondLists.bounded n xs) {f : Bond} (hf : f ∈ xs) :
|
| 42 |
+
∃ e ∈ value n xs, s(e.1,e.2.1) = s(f.1,f.2.1) := by
|
| 43 |
+
have hp : ordered f ∈ support n xs :=
|
| 44 |
+
(mem_support hb _).mpr (List.mem_map.mpr ⟨f,hf,rfl⟩)
|
| 45 |
+
refine ⟨((ordered f).1,(ordered f).2,weight xs (ordered f)),?_,ordered_endpointPair f⟩
|
| 46 |
+
exact List.mem_map.mpr ⟨ordered f,hp,rfl⟩
|
| 47 |
+
|
| 48 |
+
theorem value_support {n : ℕ} {xs : List Bond}
|
| 49 |
+
(hb : SourceBondLists.bounded n xs) (p : Sym2 ℕ) :
|
| 50 |
+
(∃ e ∈ value n xs, s(e.1,e.2.1) = p) ↔ ∃ e ∈ xs, s(e.1,e.2.1) = p := by
|
| 51 |
+
constructor
|
| 52 |
+
· rintro ⟨e,he,hp⟩
|
| 53 |
+
obtain ⟨f,hf,hef⟩ := value_edge_source n xs he
|
| 54 |
+
exact ⟨f,hf,hef.symm.trans hp⟩
|
| 55 |
+
· rintro ⟨f,hf,hp⟩
|
| 56 |
+
obtain ⟨e,he,hef⟩ := value_edge_target hb hf
|
| 57 |
+
exact ⟨e,he,hef.trans hp⟩
|
| 58 |
+
|
| 59 |
+
end QuantumListMerge
|
| 60 |
+
|
| 61 |
+
namespace QMARationalExchangeGraph
|
| 62 |
+
|
| 63 |
+
theorem orderedPair_endpointPair (G : QMARationalExchangeGraph) (e : G.Edge) :
|
| 64 |
+
s((G.orderedPair e).1,(G.orderedPair e).2) = s(G.left e,G.right e) := by
|
| 65 |
+
rcases le_total (G.left e) (G.right e) with h | h
|
| 66 |
+
· simp only [orderedPair,min_eq_left h,max_eq_right h]
|
| 67 |
+
· simpa only [orderedPair,min_eq_right h,max_eq_left h] using
|
| 68 |
+
(Sym2.eq_swap : s(G.right e,G.left e) = s(G.left e,G.right e))
|
| 69 |
+
|
| 70 |
+
theorem merge_unordered_source (G : QMARationalExchangeGraph) (e : G.merge.Edge) :
|
| 71 |
+
∃ f : G.Edge, s(G.merge.left e,G.merge.right e) = s(G.left f,G.right f) := by
|
| 72 |
+
obtain ⟨f,hf⟩ := G.merge_edge_source e
|
| 73 |
+
exact ⟨f,Sym2.eq_iff.mpr hf⟩
|
| 74 |
+
|
| 75 |
+
theorem merge_unordered_target (G : QMARationalExchangeGraph) (f : G.Edge) :
|
| 76 |
+
∃ e : G.merge.Edge, s(G.merge.left e,G.merge.right e) = s(G.left f,G.right f) :=
|
| 77 |
+
⟨G.edgeClass f,G.orderedPair_endpointPair f⟩
|
| 78 |
+
|
| 79 |
+
theorem merge_support (G : QMARationalExchangeGraph) (p : Sym2 (Fin G.n)) :
|
| 80 |
+
(∃ e : G.merge.Edge, s(G.merge.left e,G.merge.right e) = p) ↔
|
| 81 |
+
∃ f : G.Edge, s(G.left f,G.right f) = p := by
|
| 82 |
+
constructor
|
| 83 |
+
· rintro ⟨e,hp⟩
|
| 84 |
+
obtain ⟨f,hef⟩ := G.merge_unordered_source e
|
| 85 |
+
exact ⟨f,hef.symm.trans hp⟩
|
| 86 |
+
· rintro ⟨f,hp⟩
|
| 87 |
+
obtain ⟨e,hef⟩ := G.merge_unordered_target f
|
| 88 |
+
exact ⟨e,hef.trans hp⟩
|
| 89 |
+
|
| 90 |
+
theorem merge_nat_support (G : QMARationalExchangeGraph) (p : Sym2 ℕ) :
|
| 91 |
+
(∃ e : G.merge.Edge, s((G.merge.left e).val,(G.merge.right e).val) = p) ↔
|
| 92 |
+
∃ f : G.Edge, s((G.left f).val,(G.right f).val) = p := by
|
| 93 |
+
constructor
|
| 94 |
+
· rintro ⟨e,hp⟩
|
| 95 |
+
obtain ⟨f,hef⟩ := G.merge_unordered_source e
|
| 96 |
+
exact ⟨f,(qmaUnorderedPair_map Fin.val hef).symm.trans hp⟩
|
| 97 |
+
· rintro ⟨f,hp⟩
|
| 98 |
+
obtain ⟨e,hef⟩ := G.merge_unordered_target f
|
| 99 |
+
exact ⟨e,(qmaUnorderedPair_map Fin.val hef).trans hp⟩
|
| 100 |
+
|
| 101 |
+
variable (G H : QMARationalExchangeGraph) (vertex : Fin G.n ≃ Fin H.n)
|
| 102 |
+
|
| 103 |
+
theorem merge_support_forward
|
| 104 |
+
(forward : ∀ e : G.Edge, ∃ f : H.Edge,
|
| 105 |
+
s(vertex (G.left e),vertex (G.right e)) = s(H.left f,H.right f))
|
| 106 |
+
(e : G.merge.Edge) :
|
| 107 |
+
∃ f : H.merge.Edge,
|
| 108 |
+
s(vertex (G.merge.left e),vertex (G.merge.right e)) = s(H.merge.left f,H.merge.right f) := by
|
| 109 |
+
obtain ⟨a,ha⟩ := G.merge_unordered_source e
|
| 110 |
+
obtain ⟨b,hb⟩ := forward a
|
| 111 |
+
obtain ⟨f,hf⟩ := H.merge_unordered_target b
|
| 112 |
+
exact ⟨f,(qmaUnorderedPair_map vertex ha).trans (hb.trans hf.symm)⟩
|
| 113 |
+
|
| 114 |
+
theorem merge_support_backward
|
| 115 |
+
(backward : ∀ f : H.Edge, ∃ e : G.Edge,
|
| 116 |
+
s(vertex (G.left e),vertex (G.right e)) = s(H.left f,H.right f))
|
| 117 |
+
(f : H.merge.Edge) :
|
| 118 |
+
∃ e : G.merge.Edge,
|
| 119 |
+
s(vertex (G.merge.left e),vertex (G.merge.right e)) = s(H.merge.left f,H.merge.right f) := by
|
| 120 |
+
obtain ⟨b,hb⟩ := H.merge_unordered_source f
|
| 121 |
+
obtain ⟨a,ha⟩ := backward b
|
| 122 |
+
obtain ⟨e,he⟩ := G.merge_unordered_target a
|
| 123 |
+
exact ⟨e,(qmaUnorderedPair_map vertex he).trans (ha.trans hb.symm)⟩
|
| 124 |
+
|
| 125 |
+
end QMARationalExchangeGraph
|
| 126 |
+
|
| 127 |
+
namespace QuantumListGraph
|
| 128 |
+
open MediatorListProgram
|
| 129 |
+
|
| 130 |
+
theorem ofBonds_nat_support (n : ℕ) (xs : List Bond) (c : ℚ)
|
| 131 |
+
(hb : SourceBondLists.bounded n xs) (hn : ∀ e ∈ xs, e.1 ≠ e.2.1)
|
| 132 |
+
(p : Sym2 ℕ) :
|
| 133 |
+
(∃ i : (ofBonds n xs c hb hn).Edge,
|
| 134 |
+
s(((ofBonds n xs c hb hn).left i).val,((ofBonds n xs c hb hn).right i).val) = p) ↔
|
| 135 |
+
∃ e ∈ xs, s(e.1,e.2.1) = p := by
|
| 136 |
+
constructor
|
| 137 |
+
· rintro ⟨i,hi⟩
|
| 138 |
+
exact ⟨xs.get i,List.get_mem xs i,hi⟩
|
| 139 |
+
· rintro ⟨e,he,hp⟩
|
| 140 |
+
obtain ⟨i,hi⟩ := List.mem_iff_get.mp he
|
| 141 |
+
refine ⟨i,?_⟩
|
| 142 |
+
change s((xs.get i).1,(xs.get i).2.1) = p
|
| 143 |
+
rwa [hi]
|
| 144 |
+
|
| 145 |
+
theorem mergedTape_nat_support (n : ℕ) (xs : List Bond) (c : ℚ)
|
| 146 |
+
(hb : SourceBondLists.bounded n xs) (hn : ∀ e ∈ xs, e.1 ≠ e.2.1)
|
| 147 |
+
(p : Sym2 ℕ) :
|
| 148 |
+
(∃ i : (ofBonds n (QuantumListMerge.value n xs) c
|
| 149 |
+
(QuantumListMerge.bounded n xs) (QuantumListMerge.noLoops hn)).Edge,
|
| 150 |
+
s(((ofBonds n (QuantumListMerge.value n xs) c
|
| 151 |
+
(QuantumListMerge.bounded n xs) (QuantumListMerge.noLoops hn)).left i).val,
|
| 152 |
+
((ofBonds n (QuantumListMerge.value n xs) c
|
| 153 |
+
(QuantumListMerge.bounded n xs) (QuantumListMerge.noLoops hn)).right i).val) = p) ↔
|
| 154 |
+
∃ e : (ofBonds n xs c hb hn).merge.Edge,
|
| 155 |
+
s((((ofBonds n xs c hb hn).merge).left e).val,
|
| 156 |
+
(((ofBonds n xs c hb hn).merge).right e).val) = p := by
|
| 157 |
+
exact (ofBonds_nat_support n (QuantumListMerge.value n xs) c
|
| 158 |
+
(QuantumListMerge.bounded n xs) (QuantumListMerge.noLoops hn) p).trans
|
| 159 |
+
((QuantumListMerge.value_support hb p).trans
|
| 160 |
+
((ofBonds_nat_support n xs c hb hn p).symm.trans
|
| 161 |
+
((ofBonds n xs c hb hn).merge_nat_support p).symm))
|
| 162 |
+
|
| 163 |
+
end QuantumListGraph
|
| 164 |
+
end ContinuumCoulomb
|
| 165 |
+
|
| 166 |
+
end
|
| 167 |
+
|
| 168 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumNearestCircuit.lean
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumNearestGate
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Exact nearest-neighbor compilation with an explicit polynomial size bound. -/
|
| 6 |
+
|
| 7 |
+
noncomputable section
|
| 8 |
+
namespace ContinuumCoulomb
|
| 9 |
+
open Matrix
|
| 10 |
+
open scoped Classical
|
| 11 |
+
|
| 12 |
+
theorem qmaNearestList_matrix (work : ℕ) (gs : List QMAGate) :
|
| 13 |
+
qmaGateProduct work (gs.flatMap (qmaNearestGate work)) = qmaGateProduct work gs := by
|
| 14 |
+
induction gs with
|
| 15 |
+
| nil => rfl
|
| 16 |
+
| cons g gs ih =>
|
| 17 |
+
change qmaGateProduct work (qmaNearestGate work g ++ gs.flatMap (qmaNearestGate work)) = _
|
| 18 |
+
rw [qmaGateProduct_append,ih,qmaNearestGate_matrix]
|
| 19 |
+
change _ = qmaGateProduct work ([g]++gs)
|
| 20 |
+
rw [qmaGateProduct_append,qmaGateProduct_singleton]
|
| 21 |
+
|
| 22 |
+
theorem qmaNearestList_length (work : ℕ) (gs : List QMAGate) :
|
| 23 |
+
(gs.flatMap (qmaNearestGate work)).length ≤ (6*work+7)*gs.length := by
|
| 24 |
+
induction gs with
|
| 25 |
+
| nil => simp
|
| 26 |
+
| cons g gs ih =>
|
| 27 |
+
simp only [List.flatMap_cons,List.length_append,List.length_cons]
|
| 28 |
+
have hg := qmaNearestGate_length work g
|
| 29 |
+
nlinarith
|
| 30 |
+
|
| 31 |
+
abbrev qmaNearestCircuit (c : QMACircuit) : QMACircuit :=
|
| 32 |
+
⟨c.work,c.witness,c.gates.flatMap (qmaNearestGate c.work)⟩
|
| 33 |
+
|
| 34 |
+
theorem qmaNearestCircuit_wellFormed (c : QMACircuit) (hc : c.WellFormed) :
|
| 35 |
+
(qmaNearestCircuit c).WellFormed := by
|
| 36 |
+
refine ⟨hc.1,?_⟩
|
| 37 |
+
intro g hg
|
| 38 |
+
obtain ⟨k,hk,hg⟩ := List.mem_flatMap.mp hg
|
| 39 |
+
exact (qmaNearestGate_valid c.work k (hc.2 k hk) g hg).1
|
| 40 |
+
|
| 41 |
+
theorem qmaNearestCircuit_adjacent (c : QMACircuit) (hc : c.WellFormed) :
|
| 42 |
+
∀ g ∈ (qmaNearestCircuit c).gates, g.Adjacent := by
|
| 43 |
+
intro g hg
|
| 44 |
+
obtain ⟨k,hk,hg⟩ := List.mem_flatMap.mp hg
|
| 45 |
+
exact (qmaNearestGate_valid c.work k (hc.2 k hk) g hg).2
|
| 46 |
+
|
| 47 |
+
theorem qmaNearestCircuit_acceptance (c : QMACircuit) (hc : c.WellFormed)
|
| 48 |
+
(psi : EuclideanSpace ℂ (SourceSpinBasis c.witness)) :
|
| 49 |
+
qmaAcceptance (qmaNearestCircuit c) (qmaNearestCircuit_wellFormed c hc) psi =
|
| 50 |
+
qmaAcceptance c hc psi := by
|
| 51 |
+
have hm : qmaCircuitMatrix (qmaNearestCircuit c) = qmaCircuitMatrix c :=
|
| 52 |
+
qmaNearestList_matrix c.work c.gates
|
| 53 |
+
unfold qmaAcceptance
|
| 54 |
+
rw [hm]
|
| 55 |
+
rfl
|
| 56 |
+
|
| 57 |
+
theorem qmaNearestCircuit_size (c : QMACircuit) :
|
| 58 |
+
(qmaNearestCircuit c).work+(qmaNearestCircuit c).gates.length ≤
|
| 59 |
+
c.work+(6*c.work+7)*c.gates.length := by
|
| 60 |
+
exact Nat.add_le_add_left (qmaNearestList_length c.work c.gates) c.work
|
| 61 |
+
|
| 62 |
+
end ContinuumCoulomb
|
| 63 |
+
|
| 64 |
+
end
|
| 65 |
+
|
| 66 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumNearestGate.lean
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAdjacentCnot
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Replacing a gate by an exact bounded-length nearest-neighbor gate sequence. -/
|
| 6 |
+
|
| 7 |
+
noncomputable section
|
| 8 |
+
namespace ContinuumCoulomb
|
| 9 |
+
open Matrix
|
| 10 |
+
open scoped Classical
|
| 11 |
+
|
| 12 |
+
def QMAGate.Adjacent : QMAGate → Prop
|
| 13 |
+
| .controlledNot i j => i+1 = j ∨ j+1 = i
|
| 14 |
+
| _ => True
|
| 15 |
+
|
| 16 |
+
theorem qmaAdjacentCnot_valid (work a d : ℕ) (h : a+d+1 < work+1) (b : Bool) :
|
| 17 |
+
∀ g ∈ qmaAdjacentCnot work a d h b, g.WellFormed (work+1) ∧ g.Adjacent := by
|
| 18 |
+
induction d generalizing a with
|
| 19 |
+
| zero =>
|
| 20 |
+
intro g hg
|
| 21 |
+
have he : g = qmaOrderedCnot a (a+1) b := by simpa [qmaAdjacentCnot] using hg
|
| 22 |
+
subst g
|
| 23 |
+
cases b <;> simp only [qmaOrderedCnot,Bool.false_eq_true,ite_false,ite_true,
|
| 24 |
+
QMAGate.WellFormed,QMAGate.Adjacent]
|
| 25 |
+
· exact ⟨⟨h,by omega,by omega⟩,by simp⟩
|
| 26 |
+
· exact ⟨⟨by omega,h,by omega⟩,by simp⟩
|
| 27 |
+
| succ d ih =>
|
| 28 |
+
intro g hg
|
| 29 |
+
simp only [qmaAdjacentCnot,List.mem_append] at hg
|
| 30 |
+
rcases hg with (hg | hg) | hg
|
| 31 |
+
· have hs : g.WellFormed (work+1) := qmaWireSwapGates_wellFormed
|
| 32 |
+
(⟨a,by omega⟩ : Fin (work+1)) ⟨a+1,by omega⟩ (by intro he; cases he) g hg
|
| 33 |
+
refine ⟨hs,?_⟩
|
| 34 |
+
simp only [qmaWireSwapGates,List.mem_cons,List.not_mem_nil,or_false] at hg
|
| 35 |
+
rcases hg with rfl | rfl | rfl <;> simp [QMAGate.Adjacent]
|
| 36 |
+
· exact ih (a+1) (by omega) g hg
|
| 37 |
+
· have hs : g.WellFormed (work+1) := qmaWireSwapGates_wellFormed
|
| 38 |
+
(⟨a,by omega⟩ : Fin (work+1)) ⟨a+1,by omega⟩ (by intro he; cases he) g hg
|
| 39 |
+
refine ⟨hs,?_⟩
|
| 40 |
+
simp only [qmaWireSwapGates,List.mem_cons,List.not_mem_nil,or_false] at hg
|
| 41 |
+
rcases hg with rfl | rfl | rfl <;> simp [QMAGate.Adjacent]
|
| 42 |
+
|
| 43 |
+
def qmaNearestGate (work : ℕ) : QMAGate → List QMAGate
|
| 44 |
+
| .controlledNot i j =>
|
| 45 |
+
if h : i < j ∧ j < work+1 then
|
| 46 |
+
qmaAdjacentCnot work i (j-i-1) (by omega) true
|
| 47 |
+
else if h : j < i ∧ i < work+1 then
|
| 48 |
+
qmaAdjacentCnot work j (i-j-1) (by omega) false
|
| 49 |
+
else [.controlledNot i j]
|
| 50 |
+
| g => [g]
|
| 51 |
+
|
| 52 |
+
theorem qmaNearestGate_matrix (work : ℕ) (g : QMAGate) :
|
| 53 |
+
qmaGateProduct work (qmaNearestGate work g) = qmaGateMatrix work g := by
|
| 54 |
+
cases g with
|
| 55 |
+
| hadamard i => exact qmaGateProduct_singleton _ _
|
| 56 |
+
| phaseT i => exact qmaGateProduct_singleton _ _
|
| 57 |
+
| controlledNot i j =>
|
| 58 |
+
by_cases h : i < j ∧ j < work+1
|
| 59 |
+
· simp only [qmaNearestGate,dite_eq_left h,qmaAdjacentCnot_matrix,qmaOrderedCnot,ite_true]
|
| 60 |
+
have he : i+(j-i-1)+1 = j := by omega
|
| 61 |
+
rw [he]
|
| 62 |
+
· by_cases h' : j < i ∧ i < work+1
|
| 63 |
+
· simp only [qmaNearestGate,dite_eq_right h,dite_eq_left h',qmaAdjacentCnot_matrix,
|
| 64 |
+
qmaOrderedCnot,Bool.false_eq_true,ite_false]
|
| 65 |
+
have he : j+(i-j-1)+1 = i := by omega
|
| 66 |
+
rw [he]
|
| 67 |
+
· simp only [qmaNearestGate,dite_eq_right h,dite_eq_right h',qmaGateProduct_singleton]
|
| 68 |
+
|
| 69 |
+
theorem qmaNearestGate_valid (work : ℕ) (g : QMAGate) (hg : g.WellFormed (work+1)) :
|
| 70 |
+
∀ k ∈ qmaNearestGate work g, k.WellFormed (work+1) ∧ k.Adjacent := by
|
| 71 |
+
cases g with
|
| 72 |
+
| hadamard i => simpa [qmaNearestGate,QMAGate.Adjacent] using hg
|
| 73 |
+
| phaseT i => simpa [qmaNearestGate,QMAGate.Adjacent] using hg
|
| 74 |
+
| controlledNot i j =>
|
| 75 |
+
rcases hg with ⟨hi,hj,hne⟩
|
| 76 |
+
by_cases h : i < j ∧ j < work+1
|
| 77 |
+
· simp only [qmaNearestGate,dite_eq_left h]
|
| 78 |
+
exact qmaAdjacentCnot_valid _ _ _ _ _
|
| 79 |
+
· have h' : j < i ∧ i < work+1 := by omega
|
| 80 |
+
simp only [qmaNearestGate,dite_eq_right h,dite_eq_left h']
|
| 81 |
+
exact qmaAdjacentCnot_valid _ _ _ _ _
|
| 82 |
+
|
| 83 |
+
theorem qmaNearestGate_length (work : ℕ) (g : QMAGate) :
|
| 84 |
+
(qmaNearestGate work g).length ≤ 6*work+7 := by
|
| 85 |
+
cases g with
|
| 86 |
+
| hadamard i => simp [qmaNearestGate]
|
| 87 |
+
| phaseT i => simp [qmaNearestGate]
|
| 88 |
+
| controlledNot i j =>
|
| 89 |
+
by_cases h : i < j ∧ j < work+1
|
| 90 |
+
· simp only [qmaNearestGate,dite_eq_left h,qmaAdjacentCnot_length]
|
| 91 |
+
omega
|
| 92 |
+
· by_cases h' : j < i ∧ i < work+1
|
| 93 |
+
· simp only [qmaNearestGate,dite_eq_right h,dite_eq_left h',qmaAdjacentCnot_length]
|
| 94 |
+
omega
|
| 95 |
+
· simp only [qmaNearestGate,dite_eq_right h,dite_eq_right h',List.length_singleton]
|
| 96 |
+
omega
|
| 97 |
+
|
| 98 |
+
end ContinuumCoulomb
|
| 99 |
+
|
| 100 |
+
end
|
| 101 |
+
|
| 102 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumNearestProgram.lean
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAdjacentProgram
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Literal nearest-neighbor gate compilation. All finite loops use the
|
| 6 |
+
unary work bound; malformed gate indices take the original singleton branch. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb.QuantumCircuitCode
|
| 10 |
+
open ExactQuantumFactoring.BitStackProgram
|
| 11 |
+
|
| 12 |
+
abbrev NearestInput := ℕ × QMAGate
|
| 13 |
+
def nearestInputCode : NearestInput → List Bool := prodCode unaryCode gateCode
|
| 14 |
+
|
| 15 |
+
def forwardGuard (x : NearestInput) : Bool :=
|
| 16 |
+
decide (gateLeft x.2+1 ≤ gateRight x.2 ∧ gateRight x.2 ≤ x.1)
|
| 17 |
+
def backwardGuard (x : NearestInput) : Bool :=
|
| 18 |
+
decide (gateRight x.2+1 ≤ gateLeft x.2 ∧ gateLeft x.2 ≤ x.1)
|
| 19 |
+
|
| 20 |
+
def nearestValue (x : NearestInput) : List QMAGate :=
|
| 21 |
+
if gateTag x.2=2 then
|
| 22 |
+
if forwardGuard x then
|
| 23 |
+
adjacentList (gateLeft x.2) (min x.1 (gateRight x.2-gateLeft x.2-1)) true
|
| 24 |
+
else if backwardGuard x then
|
| 25 |
+
adjacentList (gateRight x.2) (min x.1 (gateLeft x.2-gateRight x.2-1)) false
|
| 26 |
+
else [x.2]
|
| 27 |
+
else [x.2]
|
| 28 |
+
|
| 29 |
+
theorem nearestValue_eq (x : NearestInput) : nearestValue x=qmaNearestGate x.1 x.2 := by
|
| 30 |
+
rcases x with ⟨work,g⟩
|
| 31 |
+
cases g with
|
| 32 |
+
| hadamard i => rfl
|
| 33 |
+
| phaseT i => rfl
|
| 34 |
+
| controlledNot i j =>
|
| 35 |
+
by_cases h : i < j ∧ j < work+1
|
| 36 |
+
· have hg : forwardGuard (work,.controlledNot i j)=true := by
|
| 37 |
+
change decide (i+1 ≤ j ∧ j ≤ work) = true
|
| 38 |
+
simp only [decide_eq_true_eq]
|
| 39 |
+
omega
|
| 40 |
+
have hd : j-i-1 ≤ work := by omega
|
| 41 |
+
simp only [nearestValue,gateTag,gateLeft,gateRight,ite_true,hg,min_eq_right hd,
|
| 42 |
+
qmaNearestGate,dite_eq_left h]
|
| 43 |
+
exact (adjacentList_eq work i (j-i-1) (by omega) true).symm
|
| 44 |
+
· have hg : forwardGuard (work,.controlledNot i j)=false := by
|
| 45 |
+
change decide (i+1 ≤ j ∧ j ≤ work) = false
|
| 46 |
+
simp only [decide_eq_false_iff_not]
|
| 47 |
+
omega
|
| 48 |
+
by_cases h' : j < i ∧ i < work+1
|
| 49 |
+
· have hr : backwardGuard (work,.controlledNot i j)=true := by
|
| 50 |
+
change decide (j+1 ≤ i ∧ i ≤ work) = true
|
| 51 |
+
simp only [decide_eq_true_eq]
|
| 52 |
+
omega
|
| 53 |
+
have hd : i-j-1 ≤ work := by omega
|
| 54 |
+
simp only [nearestValue,gateTag,gateLeft,gateRight,ite_true,hg,Bool.false_eq_true,ite_false,hr,min_eq_right hd,
|
| 55 |
+
qmaNearestGate,dite_eq_right h,dite_eq_left h']
|
| 56 |
+
exact (adjacentList_eq work j (i-j-1) (by omega) false).symm
|
| 57 |
+
· have hr : backwardGuard (work,.controlledNot i j)=false := by
|
| 58 |
+
change decide (j+1 ≤ i ∧ i ≤ work) = false
|
| 59 |
+
simp only [decide_eq_false_iff_not]
|
| 60 |
+
omega
|
| 61 |
+
simp only [nearestValue,gateTag,gateLeft,gateRight,ite_true,hg,hr,Bool.false_eq_true,ite_false,
|
| 62 |
+
qmaNearestGate,dite_eq_right h,dite_eq_right h']
|
| 63 |
+
|
| 64 |
+
private noncomputable def workBits : Procedure nearestInputCode Nat.bits Prod.fst :=
|
| 65 |
+
Procedure.unaryToBits.comp (Procedure.first unaryCode gateCode)
|
| 66 |
+
private noncomputable def leftBits : Procedure nearestInputCode Nat.bits (fun x => gateLeft x.2) :=
|
| 67 |
+
gateLeftProgram.comp (Procedure.second unaryCode gateCode)
|
| 68 |
+
private noncomputable def rightBits : Procedure nearestInputCode Nat.bits (fun x => gateRight x.2) :=
|
| 69 |
+
gateRightProgram.comp (Procedure.second unaryCode gateCode)
|
| 70 |
+
|
| 71 |
+
noncomputable def forwardGuardProgram : Procedure nearestInputCode Procedure.boolCode forwardGuard :=
|
| 72 |
+
(Procedure.boolAnd.comp
|
| 73 |
+
((Procedure.binaryLe.comp ((Procedure.successor.comp leftBits).pair rightBits)).pair
|
| 74 |
+
(Procedure.binaryLe.comp (rightBits.pair workBits)))).congrFun (by
|
| 75 |
+
intro x
|
| 76 |
+
simp [forwardGuard,Function.comp_apply])
|
| 77 |
+
|
| 78 |
+
noncomputable def backwardGuardProgram : Procedure nearestInputCode Procedure.boolCode backwardGuard :=
|
| 79 |
+
(Procedure.boolAnd.comp
|
| 80 |
+
((Procedure.binaryLe.comp ((Procedure.successor.comp rightBits).pair leftBits)).pair
|
| 81 |
+
(Procedure.binaryLe.comp (leftBits.pair workBits)))).congrFun (by
|
| 82 |
+
intro x
|
| 83 |
+
simp [backwardGuard,Function.comp_apply])
|
| 84 |
+
|
| 85 |
+
noncomputable def nearestProgram : Procedure nearestInputCode (listCode gateCode) nearestValue := by
|
| 86 |
+
let work := Procedure.first unaryCode gateCode
|
| 87 |
+
let gate := Procedure.second unaryCode gateCode
|
| 88 |
+
let one := (Procedure.listCons gateCode).comp
|
| 89 |
+
(gate.pair (Procedure.constant nearestInputCode (listCode gateCode) []))
|
| 90 |
+
let dForward := Procedure.binarySub.comp
|
| 91 |
+
((Procedure.binarySub.comp (rightBits.pair leftBits)).pair
|
| 92 |
+
(Procedure.constant nearestInputCode Nat.bits 1))
|
| 93 |
+
let dBackward := Procedure.binarySub.comp
|
| 94 |
+
((Procedure.binarySub.comp (leftBits.pair rightBits)).pair
|
| 95 |
+
(Procedure.constant nearestInputCode Nat.bits 1))
|
| 96 |
+
let forward := adjacentProgram.comp ((Procedure.clippedUnary.comp (work.pair dForward)).pair
|
| 97 |
+
(leftBits.pair (Procedure.constant nearestInputCode Procedure.boolCode true)))
|
| 98 |
+
let backward := adjacentProgram.comp ((Procedure.clippedUnary.comp (work.pair dBackward)).pair
|
| 99 |
+
(rightBits.pair (Procedure.constant nearestInputCode Procedure.boolCode false)))
|
| 100 |
+
let cnot := Procedure.binaryEq.comp ((gateTagProgram.comp gate).pair
|
| 101 |
+
(Procedure.constant nearestInputCode Nat.bits 2))
|
| 102 |
+
exact (Procedure.conditional cnot
|
| 103 |
+
(Procedure.conditional forwardGuardProgram forward
|
| 104 |
+
(Procedure.conditional backwardGuardProgram backward one)) one).congrFun (by
|
| 105 |
+
intro x
|
| 106 |
+
simp only [nearestValue,Function.comp_apply,decide_eq_true_eq])
|
| 107 |
+
|
| 108 |
+
noncomputable def nearestListProgram :
|
| 109 |
+
Procedure circuitCode (listCode gateCode) (fun c => c.gates.flatMap (qmaNearestGate c.work)) := by
|
| 110 |
+
let rows := Procedure.listMapWith (ea := unaryCode) (eb := gateCode) (ec := listCode gateCode)
|
| 111 |
+
(f := fun work g => nearestValue (work,g)) (.hadamard 0) [] nearestProgram
|
| 112 |
+
exact ((QuantumRawExchange.flattenProgram gateCode (.hadamard 0)).comp
|
| 113 |
+
(rows.comp (workProgram.pair gatesProgram))).congrFun (by
|
| 114 |
+
intro c
|
| 115 |
+
simp only [Function.comp_apply,List.flatMap_def]
|
| 116 |
+
congr 1
|
| 117 |
+
apply List.map_congr_left
|
| 118 |
+
intro g _
|
| 119 |
+
exact nearestValue_eq (c.work,g))
|
| 120 |
+
|
| 121 |
+
noncomputable def nearestCircuitProgram : Procedure circuitCode circuitCode qmaNearestCircuit :=
|
| 122 |
+
(workProgram.pair (witnessProgram.pair nearestListProgram)).result (by intro c; rfl)
|
| 123 |
+
|
| 124 |
+
end ContinuumCoulomb.QuantumCircuitCode
|
| 125 |
+
|
| 126 |
+
end
|
| 127 |
+
|
| 128 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOddPathGeometry.lean
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumGridWalk
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! The odd subdivision gadget splits a routed edge into two unit edges and
|
| 6 |
+
its reversed remaining tail. The two fresh vertices are the first two route points. -/
|
| 7 |
+
|
| 8 |
+
namespace ContinuumCoulomb
|
| 9 |
+
|
| 10 |
+
def qmaOddSplitLength (L : ℕ) : Fin 3 → ℕ := ![1,1,L-2]
|
| 11 |
+
def qmaOddSplitIndex (L : ℕ) (e : Fin 3) (k : ℕ) : ℕ :=
|
| 12 |
+
if e = 0 then k+1 else if e = 1 then k else L-k
|
| 13 |
+
|
| 14 |
+
theorem qmaOddSplitIndex_bounds {L : ℕ} (hL : 3 ≤ L) (e : Fin 3) {k : ℕ}
|
| 15 |
+
(hk : k ≤ qmaOddSplitLength L e) : qmaOddSplitIndex L e k ≤ L := by
|
| 16 |
+
fin_cases e <;> simp [qmaOddSplitLength,qmaOddSplitIndex] at * <;> omega
|
| 17 |
+
|
| 18 |
+
theorem qmaOddSplitIndex_zero (L : ℕ) :
|
| 19 |
+
(fun e => qmaOddSplitIndex L e 0) = ![1,0,L] := by
|
| 20 |
+
funext e
|
| 21 |
+
fin_cases e <;> simp [qmaOddSplitIndex]
|
| 22 |
+
|
| 23 |
+
theorem qmaOddSplitIndex_last {L : ℕ} (hL : 3 ≤ L) :
|
| 24 |
+
(fun e => qmaOddSplitIndex L e (qmaOddSplitLength L e)) = ![2,1,2] := by
|
| 25 |
+
funext e
|
| 26 |
+
fin_cases e <;> simp [qmaOddSplitLength,qmaOddSplitIndex]
|
| 27 |
+
omega
|
| 28 |
+
|
| 29 |
+
theorem qmaOddSplitIndex_injective {L : ℕ} (hL : 3 ≤ L) (e : Fin 3)
|
| 30 |
+
{i j : ℕ} (hi : i ≤ qmaOddSplitLength L e) (hj : j ≤ qmaOddSplitLength L e)
|
| 31 |
+
(h : qmaOddSplitIndex L e i = qmaOddSplitIndex L e j) : i = j := by
|
| 32 |
+
fin_cases e <;> (simp [qmaOddSplitLength,qmaOddSplitIndex] at *; omega)
|
| 33 |
+
|
| 34 |
+
theorem qmaOddSplitIndex_interior {L : ℕ} (hL : 3 ≤ L) (e : Fin 3) {i : ℕ}
|
| 35 |
+
(hi0 : 0 < i) (hi : i < qmaOddSplitLength L e) :
|
| 36 |
+
e = 2 ∧ 2 < qmaOddSplitIndex L e i ∧ qmaOddSplitIndex L e i < L := by
|
| 37 |
+
fin_cases e <;> simp [qmaOddSplitLength,qmaOddSplitIndex] at * <;> omega
|
| 38 |
+
|
| 39 |
+
theorem qmaOddSplitIndex_separated {L : ℕ} (hL : 3 ≤ L) (e f : Fin 3) {i j : ℕ}
|
| 40 |
+
(hi0 : 0 < i) (hi : i < qmaOddSplitLength L e)
|
| 41 |
+
(hj : j ≤ qmaOddSplitLength L f)
|
| 42 |
+
(h : qmaOddSplitIndex L e i = qmaOddSplitIndex L f j) : e = f := by
|
| 43 |
+
obtain ⟨rfl,hi2,hiL⟩ := qmaOddSplitIndex_interior hL e hi0 hi
|
| 44 |
+
fin_cases f <;> simp [qmaOddSplitLength,qmaOddSplitIndex] at * <;> omega
|
| 45 |
+
|
| 46 |
+
theorem qmaOddSplitIndex_step {L : ℕ} (hL : 3 ≤ L) (e : Fin 3) {i : ℕ}
|
| 47 |
+
(hi : i < qmaOddSplitLength L e) :
|
| 48 |
+
qmaOddSplitIndex L e (i+1) = qmaOddSplitIndex L e i+1 ∨
|
| 49 |
+
qmaOddSplitIndex L e i = qmaOddSplitIndex L e (i+1)+1 := by
|
| 50 |
+
fin_cases e <;> simp [qmaOddSplitLength,qmaOddSplitIndex] at *
|
| 51 |
+
omega
|
| 52 |
+
|
| 53 |
+
theorem qmaOddSplitPoint_step {L : ℕ} (hL : 3 ≤ L) (p : ℕ → ℕ × ℕ)
|
| 54 |
+
(hp : ∀ i < L, qmaSquareGrid.Adj (p i) (p (i+1))) (e : Fin 3) {i : ℕ}
|
| 55 |
+
(hi : i < qmaOddSplitLength L e) :
|
| 56 |
+
qmaSquareGrid.Adj (p (qmaOddSplitIndex L e i)) (p (qmaOddSplitIndex L e (i+1))) := by
|
| 57 |
+
rcases qmaOddSplitIndex_step hL e hi with h | h
|
| 58 |
+
· have hn := qmaOddSplitIndex_bounds hL e (k := i+1) (Nat.succ_le_iff.mpr hi)
|
| 59 |
+
have hk : qmaOddSplitIndex L e i < L := by omega
|
| 60 |
+
simpa only [h] using hp (qmaOddSplitIndex L e i) hk
|
| 61 |
+
· have hb := qmaOddSplitIndex_bounds hL e (k := i) (Nat.le_of_lt hi)
|
| 62 |
+
have hk : qmaOddSplitIndex L e (i+1) < L := by omega
|
| 63 |
+
simpa only [h] using (hp (qmaOddSplitIndex L e (i+1)) hk).symm
|
| 64 |
+
|
| 65 |
+
end ContinuumCoulomb
|
| 66 |
+
|
| 67 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOffsetProgram.lean
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOffsetSample
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Polynomial programs for the counterterm field coefficients and scalar offset. -/
|
| 6 |
+
|
| 7 |
+
noncomputable section
|
| 8 |
+
namespace ContinuumCoulomb.QuantumAxisSample
|
| 9 |
+
open ExactQuantumFactoring.BitStackProgram
|
| 10 |
+
|
| 11 |
+
noncomputable opaque shiftValueProgram (a : Fin 2) : Procedure ratCode ratCode (shiftValue a) := by
|
| 12 |
+
by_cases ha : a = 0
|
| 13 |
+
· exact (Procedure.constant ratCode ratCode 0).congrFun (by intro t; simp [shiftValue,ha])
|
| 14 |
+
· exact (Procedure.ratMul.comp ((Procedure.identity ratCode).pair
|
| 15 |
+
(Procedure.constant ratCode ratCode (1/2)))).congrFun (by
|
| 16 |
+
intro t
|
| 17 |
+
simp only [shiftValue,ha,ite_false,Function.comp_apply,id_eq]
|
| 18 |
+
ring)
|
| 19 |
+
|
| 20 |
+
noncomputable opaque counterFieldAProgram (a b : Fin 2) (e : Fin 3) :
|
| 21 |
+
Procedure radialCode ratCode (fun x => fieldValue x.1 a (counterA x.1 a b x.2) e) :=
|
| 22 |
+
((fieldValueProgram a e).comp (inputPrecisionProgram.pair (counterAProgram a b))).congrFun
|
| 23 |
+
(by intro x; rfl)
|
| 24 |
+
|
| 25 |
+
noncomputable opaque counterFieldBProgram (a b : Fin 2) (e : Fin 3) :
|
| 26 |
+
Procedure radialCode ratCode (fun x => fieldValue x.1 b (counterB x.1 a b x.2) e) :=
|
| 27 |
+
((fieldValueProgram b e).comp (inputPrecisionProgram.pair (counterBProgram a b))).congrFun
|
| 28 |
+
(by intro x; rfl)
|
| 29 |
+
|
| 30 |
+
noncomputable opaque offsetProgram (a b : Fin 2) : Procedure radialCode ratCode
|
| 31 |
+
(fun x => offset x.1 a b x.2) := by
|
| 32 |
+
let left := (shiftValueProgram a).comp (counterAProgram a b)
|
| 33 |
+
let right := (shiftValueProgram b).comp (counterBProgram a b)
|
| 34 |
+
let first := Procedure.ratMul.comp ((factorProgram a b).pair (Procedure.constant radialCode ratCode (shift a true)))
|
| 35 |
+
let second := (shiftProgram b).comp inputCoefficientProgram
|
| 36 |
+
let product := Procedure.ratMul.comp (first.pair second)
|
| 37 |
+
exact (Procedure.ratSub.comp ((Procedure.ratAdd.comp (left.pair right)).pair product)).congrFun
|
| 38 |
+
(by intro x; rfl)
|
| 39 |
+
|
| 40 |
+
noncomputable def offsetCertificate (a b : Fin 2) : Turing.TM2ComputableInPolyTime
|
| 41 |
+
radialCode ratCode (fun x => offset x.1 a b x.2) := (offsetProgram a b).toTM2
|
| 42 |
+
|
| 43 |
+
end ContinuumCoulomb.QuantumAxisSample
|
| 44 |
+
|
| 45 |
+
end
|
| 46 |
+
|
| 47 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOffsetSample.lean
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumCountertermProgram
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumFieldSample
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Error bounds for the sampled counterterm fields and their scalar shifts. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb.QuantumAxisSample
|
| 10 |
+
open ExactQuantumFactoring.BitStackProgram
|
| 11 |
+
open scoped Classical
|
| 12 |
+
|
| 13 |
+
theorem counterA_abs (k : ℕ) (a b : Fin 2) (t : ℚ) :
|
| 14 |
+
|(counterA k a b t:ℝ)| ≤ 400*|(t:ℝ)| := by
|
| 15 |
+
simp only [counterA,Rat.cast_mul,Rat.cast_abs,shift_cast,sign_cast,abs_mul,abs_abs,
|
| 16 |
+
abs_of_nonneg (value_bounds k b).1]
|
| 17 |
+
calc
|
| 18 |
+
_ ≤ (|(t:ℝ)| *1)*400 := mul_le_mul
|
| 19 |
+
(mul_le_mul_of_nonneg_left (value_bounds k b).2 (abs_nonneg _))
|
| 20 |
+
(qmaFourAxisShift_abs_bound b _) (abs_nonneg _) (by positivity)
|
| 21 |
+
_ = _ := by ring
|
| 22 |
+
|
| 23 |
+
theorem counterB_abs (k : ℕ) (a b : Fin 2) (t : ℚ) :
|
| 24 |
+
|(counterB k a b t:ℝ)| ≤ 400*|(t:ℝ)| := by
|
| 25 |
+
simp only [counterB,Rat.cast_mul,Rat.cast_abs,shift_cast,polarity_cast,abs_mul,abs_abs,
|
| 26 |
+
abs_of_nonneg (value_bounds k a).1,qmaFourAxisSign_abs,mul_one]
|
| 27 |
+
calc
|
| 28 |
+
_ ≤ (|(t:ℝ)| *1)*400 := mul_le_mul
|
| 29 |
+
(mul_le_mul_of_nonneg_left (value_bounds k a).2 (abs_nonneg _))
|
| 30 |
+
(qmaFourAxisShift_abs_bound a true) (abs_nonneg _) (by positivity)
|
| 31 |
+
_ = _ := by ring
|
| 32 |
+
|
| 33 |
+
theorem counterFieldA_error (k : ℕ) (a b : Fin 2) (t : ℚ) (e : Fin 3) :
|
| 34 |
+
|(fieldValue k a (counterA k a b t) e:ℝ)-qmaFieldEdgeWeight a (qmaFourCounterA a b (t:ℝ)) e| ≤
|
| 35 |
+
26000*|(t:ℝ)| *(2:ℝ)⁻¹^k := by
|
| 36 |
+
have hfield := fieldValue_error k a (counterA k a b t) e
|
| 37 |
+
have hcoef := counterA_abs k a b t
|
| 38 |
+
have hsample := counterA_error k a b t
|
| 39 |
+
have hweight := (fieldWeight_lipschitz a (counterA k a b t:ℝ) (qmaFourCounterA a b (t:ℝ)) e).trans hsample
|
| 40 |
+
apply ((abs_sub_le _ _ _).trans (add_le_add hfield hweight)).trans
|
| 41 |
+
have hm := mul_le_mul_of_nonneg_right hcoef (by positivity : 0 ≤ (2:ℝ)⁻¹^k)
|
| 42 |
+
nlinarith
|
| 43 |
+
|
| 44 |
+
theorem counterFieldB_error (k : ℕ) (a b : Fin 2) (t : ℚ) (e : Fin 3) :
|
| 45 |
+
|(fieldValue k b (counterB k a b t) e:ℝ)-qmaFieldEdgeWeight b (qmaFourCounterB a b (t:ℝ)) e| ≤
|
| 46 |
+
26000*|(t:ℝ)| *(2:ℝ)⁻¹^k := by
|
| 47 |
+
have hfield := fieldValue_error k b (counterB k a b t) e
|
| 48 |
+
have hcoef := counterB_abs k a b t
|
| 49 |
+
have hsample := counterB_error k a b t
|
| 50 |
+
have hweight := (fieldWeight_lipschitz b (counterB k a b t:ℝ) (qmaFourCounterB a b (t:ℝ)) e).trans hsample
|
| 51 |
+
apply ((abs_sub_le _ _ _).trans (add_le_add hfield hweight)).trans
|
| 52 |
+
have hm := mul_le_mul_of_nonneg_right hcoef (by positivity : 0 ≤ (2:ℝ)⁻¹^k)
|
| 53 |
+
nlinarith
|
| 54 |
+
|
| 55 |
+
def shiftValue (a : Fin 2) (t : ℚ) : ℚ := if a = 0 then 0 else t/2
|
| 56 |
+
|
| 57 |
+
theorem shiftValue_error (a : Fin 2) (q : ℚ) (x : ℝ) :
|
| 58 |
+
|(shiftValue a q:ℝ)-qmaFourAxisFieldShift a x| ≤ |(q:ℝ)-x| := by
|
| 59 |
+
by_cases ha : a = 0
|
| 60 |
+
· simp [shiftValue,qmaFourAxisFieldShift,ha]
|
| 61 |
+
· simp only [shiftValue,qmaFourAxisFieldShift,ha,ite_false,Rat.cast_div,Rat.cast_ofNat]
|
| 62 |
+
rw [← sub_div,abs_div]
|
| 63 |
+
norm_num
|
| 64 |
+
|
| 65 |
+
def offset (k : ℕ) (a b : Fin 2) (t : ℚ) : ℚ :=
|
| 66 |
+
shiftValue a (counterA k a b t)+shiftValue b (counterB k a b t)-
|
| 67 |
+
factor k a b t*shift a true*shift b (decide (t ≤ 0))
|
| 68 |
+
|
| 69 |
+
theorem offset_error (k : ℕ) (a b : Fin 2) (t : ℚ) :
|
| 70 |
+
|(offset k a b t:ℝ)-qmaFourEnergyOffset a b (t:ℝ)| ≤
|
| 71 |
+
320800*|(t:ℝ)| *(2:ℝ)⁻¹^k := by
|
| 72 |
+
have ha := (shiftValue_error a (counterA k a b t) (qmaFourCounterA a b (t:ℝ))).trans
|
| 73 |
+
(counterA_error k a b t)
|
| 74 |
+
have hb := (shiftValue_error b (counterB k a b t) (qmaFourCounterB a b (t:ℝ))).trans
|
| 75 |
+
(counterB_error k a b t)
|
| 76 |
+
have hc : |((factor k a b t:ℝ)-qmaFourCouplingFactor a b (t:ℝ))*qmaFourAxisShift a true*
|
| 77 |
+
qmaFourAxisShift b (qmaFourCouplingSign (t:ℝ))| ≤ 320000*|(t:ℝ)| *(2:ℝ)⁻¹^k := by
|
| 78 |
+
rw [abs_mul,abs_mul]
|
| 79 |
+
calc
|
| 80 |
+
_ ≤ ((2*|(t:ℝ)| *(2:ℝ)⁻¹^k)*400)*400 := mul_le_mul
|
| 81 |
+
(mul_le_mul (factor_error k a b t) (qmaFourAxisShift_abs_bound a true)
|
| 82 |
+
(abs_nonneg _) (by positivity)) (qmaFourAxisShift_abs_bound b _)
|
| 83 |
+
(abs_nonneg _) (by positivity)
|
| 84 |
+
_ = _ := by ring
|
| 85 |
+
have he : (offset k a b t:ℝ)-qmaFourEnergyOffset a b (t:ℝ) =
|
| 86 |
+
((shiftValue a (counterA k a b t):ℝ)-qmaFourAxisFieldShift a (qmaFourCounterA a b (t:ℝ)))+
|
| 87 |
+
((shiftValue b (counterB k a b t):ℝ)-qmaFourAxisFieldShift b (qmaFourCounterB a b (t:ℝ)))-
|
| 88 |
+
((factor k a b t:ℝ)-qmaFourCouplingFactor a b (t:ℝ))*qmaFourAxisShift a true*
|
| 89 |
+
qmaFourAxisShift b (qmaFourCouplingSign (t:ℝ)) := by
|
| 90 |
+
simp only [offset,qmaFourEnergyOffset,Rat.cast_sub,Rat.cast_add,Rat.cast_mul,shift_cast,sign_cast]
|
| 91 |
+
ring
|
| 92 |
+
rw [he]
|
| 93 |
+
apply (abs_sub _ _).trans
|
| 94 |
+
apply (add_le_add (abs_add_le _ _) le_rfl).trans
|
| 95 |
+
calc
|
| 96 |
+
_ ≤ (400*|(t:ℝ)| *(2:ℝ)⁻¹^k+400*|(t:ℝ)| *(2:ℝ)⁻¹^k)+320000*|(t:ℝ)| *(2:ℝ)⁻¹^k :=
|
| 97 |
+
add_le_add (add_le_add ha hb) hc
|
| 98 |
+
_ = _ := by ring
|
| 99 |
+
|
| 100 |
+
end ContinuumCoulomb.QuantumAxisSample
|
| 101 |
+
|
| 102 |
+
end
|
| 103 |
+
|
| 104 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOperatorQuadratic.lean
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRectangularOperator
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Matrix quadratic forms agree with the real forms of their actual
|
| 6 |
+
complex Euclidean operators, including rectangular compressions. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb
|
| 10 |
+
open Matrix
|
| 11 |
+
open scoped InnerProductSpace
|
| 12 |
+
variable {α β : Type*} [Fintype α] [Fintype β]
|
| 13 |
+
|
| 14 |
+
theorem qmaMatrixOperator_real_adjoint (B : Matrix α β ℂ)
|
| 15 |
+
(p : EuclideanSpace ℂ β) (y : EuclideanSpace ℂ α) :
|
| 16 |
+
⟪qmaMatrixOperator B p,y⟫_ℝ = ⟪p,qmaMatrixOperator B.conjTranspose y⟫_ℝ := by
|
| 17 |
+
rw [qmaEuclidean_real_inner,qmaEuclidean_real_inner]
|
| 18 |
+
have h := ContinuousLinearMap.adjoint_inner_right (qmaMatrixOperator B) p y
|
| 19 |
+
rw [← qmaMatrixOperator_star] at h
|
| 20 |
+
exact congrArg Complex.re h.symm
|
| 21 |
+
|
| 22 |
+
theorem qmaQuadratic_operator (M : Matrix α α ℂ) (p : EuclideanSpace ℂ α) :
|
| 23 |
+
qmaQuadratic M (fun i => p i) = ⟪p,qmaMatrixOperator M p⟫_ℝ := by
|
| 24 |
+
rw [qmaEuclidean_real_inner]
|
| 25 |
+
simp only [qmaQuadratic,PiLp.inner_apply,RCLike.inner_apply',qmaMatrixOperator_apply,
|
| 26 |
+
Matrix.mulVec,dotProduct,Pi.star_apply,starRingEnd_apply]
|
| 27 |
+
|
| 28 |
+
theorem qmaQuadratic_sandwich [DecidableEq α] [DecidableEq β] (B : Matrix α β ℂ) (M : Matrix α α ℂ)
|
| 29 |
+
(p : EuclideanSpace ℂ β) :
|
| 30 |
+
qmaQuadratic (B.conjTranspose*M*B) (fun i => p i) =
|
| 31 |
+
⟪qmaMatrixOperator B p,qmaMatrixOperator M (qmaMatrixOperator B p)⟫_ℝ := by
|
| 32 |
+
rw [qmaQuadratic_operator,qmaMatrixOperator_mul,qmaMatrixOperator_mul]
|
| 33 |
+
simp only [ContinuousLinearMap.comp_apply]
|
| 34 |
+
exact (qmaMatrixOperator_real_adjoint B p _).symm
|
| 35 |
+
|
| 36 |
+
theorem qmaQuadratic_sub (M N : Matrix α α ℂ) (p : α → ℂ) :
|
| 37 |
+
qmaQuadratic (M-N) p = qmaQuadratic M p-qmaQuadratic N p := by
|
| 38 |
+
have hn : qmaQuadratic (-N) p = -qmaQuadratic N p := by
|
| 39 |
+
have h := qmaQuadratic_smul N (-1) p
|
| 40 |
+
simpa using h
|
| 41 |
+
simp only [sub_eq_add_neg,qmaQuadratic_add,hn]
|
| 42 |
+
|
| 43 |
+
theorem qmaQuadratic_real_smul (M : Matrix α α ℂ) (a : ℝ) (p : α → ℂ) :
|
| 44 |
+
qmaQuadratic (a • M) p = a*qmaQuadratic M p := by
|
| 45 |
+
have he : a • M = (a:ℂ) • M := rfl
|
| 46 |
+
rw [he,qmaQuadratic_smul]
|
| 47 |
+
|
| 48 |
+
end ContinuumCoulomb
|
| 49 |
+
|
| 50 |
+
end
|
| 51 |
+
|
| 52 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedCellProgram.lean
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRoutingInputProgram
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawFamilyProgram
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Cell arrays follow the same term-major order as the literal local-word
|
| 7 |
+
compiler. Each new mediator inherits its term's cell; each output word retains
|
| 8 |
+
that cell as its anchor. -/
|
| 9 |
+
|
| 10 |
+
noncomputable section
|
| 11 |
+
namespace ContinuumCoulomb.QuantumOrderedCellProgram
|
| 12 |
+
open ExactQuantumFactoring.BitStackProgram QuantumRouteCode
|
| 13 |
+
|
| 14 |
+
abbrev State := List Pair × List Pair
|
| 15 |
+
def stateCode : State → List Bool := prodCode (listCode pairCode) (listCode pairCode)
|
| 16 |
+
|
| 17 |
+
def anchors (d : ℕ) (xs : List Pair) : List Pair :=
|
| 18 |
+
(xs.map (fun p => List.replicate d p)).flatten
|
| 19 |
+
|
| 20 |
+
def value (d : ℕ) (x : State) : State := (x.1++x.2,anchors d x.2)
|
| 21 |
+
|
| 22 |
+
noncomputable def repeatProgram (d : ℕ) :
|
| 23 |
+
Procedure pairCode (listCode pairCode) (fun p : Pair => List.replicate d p) :=
|
| 24 |
+
(QuantumRawExchange.fixedListProgram pairCode pairCode d (fun _ p => p)
|
| 25 |
+
(fun _ => Procedure.identity pairCode)).congrFun (by intro p; simp)
|
| 26 |
+
|
| 27 |
+
noncomputable def anchorsProgram (d : ℕ) :
|
| 28 |
+
Procedure (listCode pairCode) (listCode pairCode) (anchors d) :=
|
| 29 |
+
(QuantumRawExchange.flattenProgram pairCode (0,0)).comp
|
| 30 |
+
(Procedure.listMap (0,0) [] (repeatProgram d))
|
| 31 |
+
|
| 32 |
+
noncomputable def program (d : ℕ) : Procedure stateCode stateCode (value d) :=
|
| 33 |
+
(Procedure.listAppend pairCode (0,0)).pair
|
| 34 |
+
((anchorsProgram d).comp (Procedure.second (listCode pairCode) (listCode pairCode)))
|
| 35 |
+
|
| 36 |
+
theorem cells_length (d : ℕ) (x : State) : (value d x).1.length=x.1.length+x.2.length :=
|
| 37 |
+
List.length_append
|
| 38 |
+
|
| 39 |
+
theorem anchors_length (d : ℕ) (xs : List Pair) : (anchors d xs).length=xs.length*d := by
|
| 40 |
+
induction xs with
|
| 41 |
+
| nil => simp [anchors]
|
| 42 |
+
| cons p xs ih =>
|
| 43 |
+
simp only [anchors,List.map_cons,List.flatten_cons,List.length_append,List.length_replicate] at *
|
| 44 |
+
rw [ih,List.length_cons]
|
| 45 |
+
simp only [Nat.add_mul,Nat.one_mul]
|
| 46 |
+
omega
|
| 47 |
+
|
| 48 |
+
theorem cells_ofFn {n m : ℕ} (d : ℕ) (cell : Fin n → Pair) (anchor : Fin m → Pair) :
|
| 49 |
+
(value d (List.ofFn cell,List.ofFn anchor)).1=List.ofFn (Fin.append cell anchor) :=
|
| 50 |
+
(List.ofFn_fin_append cell anchor).symm
|
| 51 |
+
|
| 52 |
+
theorem anchors_ofFn {m : ℕ} (d : ℕ) (anchor : Fin m → Pair) :
|
| 53 |
+
anchors d (List.ofFn anchor)=
|
| 54 |
+
(List.ofFn (fun i : Fin m => List.ofFn (fun _ : Fin d => anchor i))).flatten := by
|
| 55 |
+
simp only [anchors,List.map_ofFn,List.ofFn_const,Function.comp_def]
|
| 56 |
+
|
| 57 |
+
end ContinuumCoulomb.QuantumOrderedCellProgram
|
| 58 |
+
|
| 59 |
+
end
|
| 60 |
+
|
| 61 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedCellTable.lean
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedSpatialComplete
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedCellProgram
|
| 3 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelOutput
|
| 4 |
+
|
| 5 |
+
namespace OAI
|
| 6 |
+
|
| 7 |
+
/-! The computed spatial arrays use exactly the same sum/product enumeration
|
| 8 |
+
as the actual ordered Hamiltonian compiler. -/
|
| 9 |
+
|
| 10 |
+
noncomputable section
|
| 11 |
+
namespace ContinuumCoulomb.QuantumOrderedCellTable
|
| 12 |
+
open QuantumOrderedCellProgram QuantumOrderedLabelTable QuantumOrderedSpatialComplete
|
| 13 |
+
open ExactQuantumFactoring.BitStackProgram
|
| 14 |
+
open QuantumRouteCode
|
| 15 |
+
variable {ι κ : Type} {n m : ℕ}
|
| 16 |
+
|
| 17 |
+
def table (q : Fin n ≃ ι) (e : Fin m ≃ κ) (cell : ι → Pair) (anchor : κ → Pair) : State :=
|
| 18 |
+
(List.ofFn (fun i => cell (q i)),List.ofFn (fun i => anchor (e i)))
|
| 19 |
+
|
| 20 |
+
theorem value_table (d : ℕ) (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 21 |
+
(cell : ι → Pair) (anchor : κ → Pair) :
|
| 22 |
+
value d (table q e cell anchor)=
|
| 23 |
+
table (nextQubit q e) (nextTerm e d) (extendCell cell anchor) (extendAnchor d anchor) := by
|
| 24 |
+
apply Prod.ext
|
| 25 |
+
· rw [show (value d (table q e cell anchor)).1=
|
| 26 |
+
List.ofFn (Fin.append (fun i => cell (q i)) (fun i => anchor (e i))) from cells_ofFn d _ _]
|
| 27 |
+
apply congrArg List.ofFn
|
| 28 |
+
funext i
|
| 29 |
+
obtain ⟨i,rfl⟩ := (finSumFinEquiv : Fin n ⊕ Fin m ≃ Fin (n+m)).surjective i
|
| 30 |
+
cases i <;> simp [nextQubit,extendCell,Fin.append]
|
| 31 |
+
· change anchors d (List.ofFn (fun i => anchor (e i)))=List.ofFn _
|
| 32 |
+
rw [anchors_ofFn]
|
| 33 |
+
rw [← product_table (fun p : Fin m × Fin d => anchor (e p.1))]
|
| 34 |
+
apply congrArg List.ofFn
|
| 35 |
+
funext i
|
| 36 |
+
rfl
|
| 37 |
+
|
| 38 |
+
def complete (x : State) : State := value 4 (value 7 (value 4 (value 7 (value 4 (value 4 x)))))
|
| 39 |
+
|
| 40 |
+
noncomputable def completeProgram : Procedure stateCode stateCode complete :=
|
| 41 |
+
(program 4).comp ((program 7).comp ((program 4).comp ((program 7).comp
|
| 42 |
+
((program 4).comp (program 4)))))
|
| 43 |
+
|
| 44 |
+
theorem complete_table (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 45 |
+
(cell : ι → Pair) (anchor : κ → Pair) :
|
| 46 |
+
complete (table q e cell anchor)=
|
| 47 |
+
table (QuantumOrderedLabelTable.qubits6 q e) (QuantumOrderedLabelTable.terms6 e)
|
| 48 |
+
(cell6 cell anchor) (anchor6 anchor) := by
|
| 49 |
+
unfold complete
|
| 50 |
+
rw [value_table,value_table,value_table,value_table,value_table,value_table]
|
| 51 |
+
rfl
|
| 52 |
+
|
| 53 |
+
end ContinuumCoulomb.QuantumOrderedCellTable
|
| 54 |
+
|
| 55 |
+
end
|
| 56 |
+
|
| 57 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedCoefficient.lean
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumAlgebraicHistory
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Exact rational-register tables for every actual ordered history term.
|
| 6 |
+
Only the propagation core is multiplied, so its summation has at most
|
| 7 |
+
32 states regardless of the number of spectator qubits. -/
|
| 8 |
+
|
| 9 |
+
noncomputable section
|
| 10 |
+
namespace ContinuumCoulomb.QuantumAlgebraicHistory
|
| 11 |
+
open QuantumAlgebraicScalar QuantumFixedPauli Matrix
|
| 12 |
+
open scoped BigOperators Classical
|
| 13 |
+
|
| 14 |
+
def diagonal {α : Type} [DecidableEq α] (f : α → ℚ) : Matrix α α Scalar :=
|
| 15 |
+
fun s t => if s = t then rat (f s) else rat 0
|
| 16 |
+
|
| 17 |
+
theorem denote_diagonal {α : Type} [DecidableEq α] (f : α → ℚ) :
|
| 18 |
+
denote (diagonal f) = Matrix.diagonal (fun s => (f s:ℂ)) := by
|
| 19 |
+
ext s t
|
| 20 |
+
by_cases h : s = t <;> simp [denote,QuantumAlgebraicHistory.diagonal,h]
|
| 21 |
+
|
| 22 |
+
def distributed (c : QMACircuit) (τ : Fin (c.work+1) → Fin (c.gates.length+1)) :
|
| 23 |
+
QMACircuitTerm c → Matrix (QMACircuitQubit c → Fin 2) (QMACircuitQubit c → Fin 2) Scalar
|
| 24 |
+
| .inl i => diagonal (fun s =>
|
| 25 |
+
if s (Sum.inl i.castSucc) = 0 ∧ s (Sum.inl i.succ) = 1 then 1 else 0)
|
| 26 |
+
| .inr (.inl b) => if b = 0 then
|
| 27 |
+
diagonal (fun s => if s (Sum.inl 0) = 1 then 0 else 1) else
|
| 28 |
+
diagonal (fun s => if s (Sum.inl (Fin.last (c.gates.length+1))) = 0 then 0 else 1)
|
| 29 |
+
| .inr (.inr (.inl i)) => diagonal (fun s =>
|
| 30 |
+
if qmaClockAt c.gates.length (τ i) (s ∘ Sum.inl) ∧
|
| 31 |
+
qmaInputCheck c i (s ∘ Sum.inr) then 14 else 0)
|
| 32 |
+
| .inr (.inr (.inr (.inl _))) => diagonal (fun s =>
|
| 33 |
+
if s (Sum.inl (qmaOutputMarker c)) = 1 ∧ s (Sum.inr (Fin.last c.work)) ≠ 1 then 1 else 0)
|
| 34 |
+
| .inr (.inr (.inr (.inr t))) => fun s r =>
|
| 35 |
+
mul (rat ((14*(c.work+1)+8)*c.gates.length:ℚ))
|
| 36 |
+
(lift (qmaPropagationSites c t) (propagationCore c t) s r)
|
| 37 |
+
|
| 38 |
+
theorem denote_distributed (c : QMACircuit)
|
| 39 |
+
(τ : Fin (c.work+1) → Fin (c.gates.length+1)) (a : QMACircuitTerm c) :
|
| 40 |
+
denote (distributed c τ a) = qmaDistributedTermMatrix c τ a := by
|
| 41 |
+
rcases a with i | (b | (i | (u | t)))
|
| 42 |
+
· ext s r
|
| 43 |
+
simp only [distributed,denote,QuantumAlgebraicHistory.diagonal,qmaDistributedTermMatrix,qmaClockFaultTerm,
|
| 44 |
+
qmaPairDiagonal,Matrix.diagonal_apply]
|
| 45 |
+
split_ifs <;> simp
|
| 46 |
+
· fin_cases b
|
| 47 |
+
· change denote (QuantumAlgebraicHistory.diagonal
|
| 48 |
+
(fun s : QMACircuitQubit c → Fin 2 => if s (Sum.inl 0) = 1 then 0 else 1)) =
|
| 49 |
+
qmaClockLeftTerm c
|
| 50 |
+
rw [denote_diagonal]
|
| 51 |
+
ext s r
|
| 52 |
+
simp only [qmaClockLeftTerm,qmaBitDiagonal,Matrix.diagonal_apply]
|
| 53 |
+
split_ifs <;> norm_num
|
| 54 |
+
· change denote (QuantumAlgebraicHistory.diagonal
|
| 55 |
+
(fun s : QMACircuitQubit c → Fin 2 =>
|
| 56 |
+
if s (Sum.inl (Fin.last (c.gates.length+1))) = 0 then 0 else 1)) =
|
| 57 |
+
qmaClockRightTerm c
|
| 58 |
+
rw [denote_diagonal]
|
| 59 |
+
ext s r
|
| 60 |
+
simp only [qmaClockRightTerm,qmaBitDiagonal,Matrix.diagonal_apply]
|
| 61 |
+
split_ifs <;> norm_num
|
| 62 |
+
· ext s r
|
| 63 |
+
simp only [distributed,denote,QuantumAlgebraicHistory.diagonal,qmaDistributedTermMatrix,
|
| 64 |
+
qmaDistributedInputTerm,Matrix.diagonal_apply]
|
| 65 |
+
split_ifs <;> simp
|
| 66 |
+
· cases u
|
| 67 |
+
ext s r
|
| 68 |
+
simp only [distributed,denote,QuantumAlgebraicHistory.diagonal,qmaDistributedTermMatrix,qmaOutputTerm,
|
| 69 |
+
qmaPairDiagonal,Matrix.diagonal_apply]
|
| 70 |
+
split_ifs <;> simp
|
| 71 |
+
· change (fun s r => value (mul _ (lift _ _ s r))) = _
|
| 72 |
+
simp only [value_mul,value_rat]
|
| 73 |
+
have hl := denote_lift (qmaPropagationSites c t) (propagationCore c t)
|
| 74 |
+
rw [denote_propagationCore] at hl
|
| 75 |
+
have hc := (qmaLocalPropagationGram_local c t).core_lift
|
| 76 |
+
rw [hc] at hl
|
| 77 |
+
ext s r
|
| 78 |
+
have he := congrFun (congrFun hl s) r
|
| 79 |
+
dsimp only [denote] at he
|
| 80 |
+
rw [he]
|
| 81 |
+
simp only [qmaDistributedTermMatrix,Matrix.smul_apply,smul_eq_mul]
|
| 82 |
+
push_cast
|
| 83 |
+
rfl
|
| 84 |
+
|
| 85 |
+
def localY (n : ℕ) (i : Fin n) (s t : SourceSpinBasis n) : Scalar :=
|
| 86 |
+
finiteProduct (fun k => if k = i then QuantumFixedPauli.pauli 2 (s k) (t k) else identity (s k) (t k))
|
| 87 |
+
|
| 88 |
+
theorem value_localY (n : ℕ) (i : Fin n) (s t : SourceSpinBasis n) :
|
| 89 |
+
value (localY n i s t) = sourceLocalPauli n i 1 s t := by
|
| 90 |
+
rw [localY,value_finiteProduct]
|
| 91 |
+
unfold sourceLocalPauli sourceTensor
|
| 92 |
+
apply Finset.prod_congr rfl
|
| 93 |
+
intro k _
|
| 94 |
+
by_cases h : k = i
|
| 95 |
+
· simp only [h,ite_true,value_pauli]
|
| 96 |
+
rfl
|
| 97 |
+
· simp only [h,ite_false,value_identity]
|
| 98 |
+
|
| 99 |
+
def rebit {ι : Type} [Fintype ι] [DecidableEq ι] (n : ℕ) (i : Fin n)
|
| 100 |
+
(A : Matrix (ι → Fin 2) (ι → Fin 2) Scalar)
|
| 101 |
+
(s t : Fin n ⊕ ι → Fin 2) : Scalar :=
|
| 102 |
+
add (mul (identity (s ∘ Sum.inl) (t ∘ Sum.inl))
|
| 103 |
+
(realPart (A (s ∘ Sum.inr) (t ∘ Sum.inr))))
|
| 104 |
+
(mul (neg imaginary) (mul (localY n i (s ∘ Sum.inl) (t ∘ Sum.inl))
|
| 105 |
+
(imagPart (A (s ∘ Sum.inr) (t ∘ Sum.inr)))))
|
| 106 |
+
|
| 107 |
+
theorem denote_rebit {ι : Type} [Fintype ι] [DecidableEq ι] (n : ℕ) (i : Fin n)
|
| 108 |
+
(A : Matrix (ι → Fin 2) (ι → Fin 2) Scalar) :
|
| 109 |
+
denote (rebit n i A) = qmaDistributedRebitOnQubits n i (denote A) := by
|
| 110 |
+
rw [qmaDistributedRebitOnQubits_eq]
|
| 111 |
+
ext s t
|
| 112 |
+
simp only [denote,rebit,value_add,value_mul,value_identity,value_realPart,value_imagPart,
|
| 113 |
+
value_neg,value_imaginary,value_localY,qmaJoinMatrix,Matrix.add_apply,
|
| 114 |
+
Matrix.smul_apply,smul_eq_mul,Matrix.submatrix_apply]
|
| 115 |
+
rfl
|
| 116 |
+
|
| 117 |
+
def pairY (n : ℕ) (i j : Fin n) (s t : SourceSpinBasis n) : Scalar :=
|
| 118 |
+
mul (mul (QuantumFixedPauli.pauli 2 (s i) (t i)) (QuantumFixedPauli.pauli 2 (s j) (t j)))
|
| 119 |
+
(rat (if ∀ k, k ≠ i → k ≠ j → s k = t k then 1 else 0))
|
| 120 |
+
|
| 121 |
+
theorem value_pairY (n : ℕ) (i j : Fin n) (hne : i ≠ j) (s t : SourceSpinBasis n) :
|
| 122 |
+
value (pairY n i j s t) = (sourceLocalPauli n i 1*sourceLocalPauli n j 1) s t := by
|
| 123 |
+
rw [sourceLocalPauli_product_entry n i j hne]
|
| 124 |
+
simp only [pairY,value_mul,value_pauli]
|
| 125 |
+
have he (a b : Fin 2) : qmaPauli 2 a b = ContinuumCoulomb.pauli 1 a b := rfl
|
| 126 |
+
rw [he,he]
|
| 127 |
+
by_cases h : ∀ k, k ≠ i → k ≠ j → s k = t k
|
| 128 |
+
· rw [ite_eq_left h,sourceSpectatorDelta_eq_one n i j s t h]
|
| 129 |
+
simp
|
| 130 |
+
· rw [ite_eq_right h,sourceSpectatorDelta_eq_zero n i j s t h]
|
| 131 |
+
simp
|
| 132 |
+
|
| 133 |
+
def referenceEdge {ι : Type} [Fintype ι] [DecidableEq ι] (n : ℕ) (i : Fin n)
|
| 134 |
+
(s t : Fin (n+1) ⊕ ι → Fin 2) : Scalar :=
|
| 135 |
+
mul (mul (rat (1/2)) (sub (identity (s ∘ Sum.inl) (t ∘ Sum.inl))
|
| 136 |
+
(pairY (n+1) i.castSucc i.succ (s ∘ Sum.inl) (t ∘ Sum.inl))))
|
| 137 |
+
(identity (s ∘ Sum.inr) (t ∘ Sum.inr))
|
| 138 |
+
|
| 139 |
+
theorem denote_referenceEdge {ι : Type} [Fintype ι] [DecidableEq ι] (n : ℕ) (i : Fin n) :
|
| 140 |
+
denote (referenceEdge (ι := ι) n i) = qmaReferenceEdgeOnQubits (ι := ι) n i := by
|
| 141 |
+
have hne : i.castSucc ≠ i.succ := by
|
| 142 |
+
intro h
|
| 143 |
+
have he := congrArg Fin.val h
|
| 144 |
+
simp at he
|
| 145 |
+
ext s t
|
| 146 |
+
simp only [denote,referenceEdge,value_mul,value_rat,value_sub,value_identity,
|
| 147 |
+
value_pairY _ _ _ hne,qmaReferenceEdgeOnQubits,qmaJoinMatrix,qmaReferenceYEdge,
|
| 148 |
+
Matrix.submatrix_apply,Matrix.kroneckerMap_apply,Matrix.smul_apply,smul_eq_mul,
|
| 149 |
+
Matrix.sub_apply]
|
| 150 |
+
norm_num
|
| 151 |
+
rfl
|
| 152 |
+
|
| 153 |
+
def orderedTerm (c : QMACircuit) (hT : 0 < c.gates.length) :
|
| 154 |
+
QMAReferenceTerm (qmaHistoryReferenceWork c) →
|
| 155 |
+
Matrix (Fin (qmaHistoryReferenceWork c+1) ⊕ QMACircuitQubit c → Fin 2)
|
| 156 |
+
(Fin (qmaHistoryReferenceWork c+1) ⊕ QMACircuitQubit c → Fin 2) Scalar
|
| 157 |
+
| .inl i => rebit (qmaHistoryReferenceWork c+1) i
|
| 158 |
+
(distributed c (qmaFirstUseTime c) (qmaOrderedTermEquiv c hT (qmaFirstUseTime c) i))
|
| 159 |
+
| .inr i => referenceEdge (qmaHistoryReferenceWork c) i
|
| 160 |
+
|
| 161 |
+
theorem denote_orderedTerm (c : QMACircuit) (hT : 0 < c.gates.length)
|
| 162 |
+
(a : QMAReferenceTerm (qmaHistoryReferenceWork c)) :
|
| 163 |
+
denote (orderedTerm c hT a) = (qmaOrderedHistoryModel c hT).matrix a := by
|
| 164 |
+
cases a with
|
| 165 |
+
| inl i =>
|
| 166 |
+
rw [orderedTerm,denote_rebit,denote_distributed]
|
| 167 |
+
rfl
|
| 168 |
+
| inr i =>
|
| 169 |
+
rw [orderedTerm,denote_referenceEdge]
|
| 170 |
+
rfl
|
| 171 |
+
|
| 172 |
+
def orderedCore (c : QMACircuit) (hT : 0 < c.gates.length)
|
| 173 |
+
(a : QMAReferenceTerm (qmaHistoryReferenceWork c)) :
|
| 174 |
+
Matrix (QMASupportBasis ((qmaOrderedHistoryModel c hT).sites a))
|
| 175 |
+
(QMASupportBasis ((qmaOrderedHistoryModel c hT).sites a)) Scalar :=
|
| 176 |
+
fun s t => orderedTerm c hT a (qmaSupportExtend _ s) (qmaSupportExtend _ t)
|
| 177 |
+
|
| 178 |
+
theorem denote_orderedCore (c : QMACircuit) (hT : 0 < c.gates.length)
|
| 179 |
+
(a : QMAReferenceTerm (qmaHistoryReferenceWork c)) :
|
| 180 |
+
denote (orderedCore c hT a) = qmaLocalCore ((qmaOrderedHistoryModel c hT).sites a)
|
| 181 |
+
((qmaOrderedHistoryModel c hT).matrix a) := by
|
| 182 |
+
ext s t
|
| 183 |
+
exact congrFun (congrFun (denote_orderedTerm c hT a) _) _
|
| 184 |
+
|
| 185 |
+
theorem orderedCoefficient_eq (c : QMACircuit) (hT : 0 < c.gates.length)
|
| 186 |
+
(a : QMAReferenceTerm (qmaHistoryReferenceWork c))
|
| 187 |
+
(w : {x // x ∈ (qmaOrderedHistoryModel c hT).sites a} → Fin 4) :
|
| 188 |
+
realValue (realCoefficient (orderedCore c hT a) w) =
|
| 189 |
+
(qmaPauliCoefficient (qmaLocalCore ((qmaOrderedHistoryModel c hT).sites a)
|
| 190 |
+
((qmaOrderedHistoryModel c hT).matrix a)) w).re := by
|
| 191 |
+
rw [realCoefficient_eq]
|
| 192 |
+
change (qmaPauliCoefficient (denote (orderedCore c hT a)) w).re = _
|
| 193 |
+
rw [denote_orderedCore]
|
| 194 |
+
|
| 195 |
+
end ContinuumCoulomb.QuantumAlgebraicHistory
|
| 196 |
+
|
| 197 |
+
end
|
| 198 |
+
|
| 199 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedDescriptorProgram.lean
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedDescriptors
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumRawFamilyProgram
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! A literal polynomial program for the exact time-grouped descriptor list. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb.QuantumHistoryDescriptors
|
| 10 |
+
open ExactQuantumFactoring.BitStackProgram QuantumCircuitCode
|
| 11 |
+
|
| 12 |
+
abbrev TimeInput := QMACircuit × Descriptor
|
| 13 |
+
def timeCode : TimeInput → List Bool := prodCode circuitCode descriptorCode
|
| 14 |
+
|
| 15 |
+
noncomputable opaque timeValueProgram : Procedure timeCode Nat.bits
|
| 16 |
+
(fun x => timeValue x.1 x.2) := by
|
| 17 |
+
let c := Procedure.first circuitCode descriptorCode
|
| 18 |
+
let d := Procedure.second circuitCode descriptorCode
|
| 19 |
+
let tag := (Procedure.first Nat.bits Nat.bits).comp d
|
| 20 |
+
let index := (Procedure.second Nat.bits Nat.bits).comp d
|
| 21 |
+
let time := Procedure.unaryToBits.comp (timeProgram.comp c)
|
| 22 |
+
let last := Procedure.binarySub.comp
|
| 23 |
+
(time.pair (Procedure.constant timeCode Nat.bits 1))
|
| 24 |
+
let test (n : ℕ) := Procedure.binaryEq.comp
|
| 25 |
+
(tag.pair (Procedure.constant timeCode Nat.bits n))
|
| 26 |
+
let minWithLast {f : TimeInput → ℕ} (p : Procedure timeCode Nat.bits f) :
|
| 27 |
+
Procedure timeCode Nat.bits (fun x => min (f x) (x.1.gates.length-1)) :=
|
| 28 |
+
(Procedure.conditional (Procedure.binaryLe.comp (p.pair last)) p last).congrFun
|
| 29 |
+
(by intro x; simp only [Function.comp_apply,id_eq,decide_eq_true_eq]; split_ifs <;> omega)
|
| 30 |
+
let firstUse := Procedure.unaryToBits.comp
|
| 31 |
+
(QuantumFirstUseProgram.program.comp (c.pair index))
|
| 32 |
+
let boundary := Procedure.conditional
|
| 33 |
+
(Procedure.binaryEq.comp (index.pair (Procedure.constant timeCode Nat.bits 0)))
|
| 34 |
+
(Procedure.constant timeCode Nat.bits 0) last
|
| 35 |
+
exact (Procedure.conditional (test 0) (minWithLast index)
|
| 36 |
+
(Procedure.conditional (test 1) boundary
|
| 37 |
+
(Procedure.conditional (test 2) (minWithLast firstUse)
|
| 38 |
+
(Procedure.conditional (test 3) last index)))).congrFun (by
|
| 39 |
+
intro x
|
| 40 |
+
simp only [timeValue,Function.comp_apply,id_eq,decide_eq_true_eq])
|
| 41 |
+
|
| 42 |
+
abbrev BucketInput := QMACircuit × ℕ
|
| 43 |
+
def bucketCode : BucketInput → List Bool := prodCode circuitCode Nat.bits
|
| 44 |
+
abbrev ChunkInput := BucketInput × Descriptor
|
| 45 |
+
def chunkCode : ChunkInput → List Bool := prodCode bucketCode descriptorCode
|
| 46 |
+
|
| 47 |
+
def chunk (x : ChunkInput) : List Descriptor :=
|
| 48 |
+
if timeValue x.1.1 x.2=x.1.2 then [x.2] else []
|
| 49 |
+
|
| 50 |
+
noncomputable opaque chunkProgram : Procedure chunkCode (listCode descriptorCode) chunk := by
|
| 51 |
+
let env := Procedure.first bucketCode descriptorCode
|
| 52 |
+
let c := (Procedure.first circuitCode Nat.bits).comp env
|
| 53 |
+
let t := (Procedure.second circuitCode Nat.bits).comp env
|
| 54 |
+
let d := Procedure.second bucketCode descriptorCode
|
| 55 |
+
let hit := Procedure.binaryEq.comp ((timeValueProgram.comp (c.pair d)).pair t)
|
| 56 |
+
let nil := Procedure.constant chunkCode (listCode descriptorCode) []
|
| 57 |
+
exact (Procedure.conditional hit ((Procedure.listCons descriptorCode).comp (d.pair nil))
|
| 58 |
+
nil).congrFun (by intro x; simp only [chunk,Function.comp_apply,decide_eq_true_eq])
|
| 59 |
+
|
| 60 |
+
private theorem chunks_eq (c : QMACircuit) (t : ℕ) (xs : List Descriptor) :
|
| 61 |
+
(xs.map (fun d => chunk ((c,t),d))).flatten =
|
| 62 |
+
xs.filter (fun d => decide (timeValue c d=t)) := by
|
| 63 |
+
induction xs with
|
| 64 |
+
| nil => rfl
|
| 65 |
+
| cons d xs ih =>
|
| 66 |
+
simp only [List.map_cons,List.flatten_cons,ih,List.filter_cons]
|
| 67 |
+
by_cases h : timeValue c d=t
|
| 68 |
+
· simp [chunk,h]
|
| 69 |
+
· simp [chunk,h]
|
| 70 |
+
|
| 71 |
+
noncomputable opaque bucketProgram : Procedure bucketCode (listCode descriptorCode)
|
| 72 |
+
(fun x => bucket x.1 x.2) := by
|
| 73 |
+
let chunks := (Procedure.listMapWith (f := fun e d => chunk (e,d)) (0,0) []
|
| 74 |
+
chunkProgram).comp ((Procedure.identity bucketCode).pair
|
| 75 |
+
(sourceProgram.comp (Procedure.first circuitCode Nat.bits)))
|
| 76 |
+
exact ((QuantumRawExchange.flattenProgram descriptorCode (0,0)).comp chunks).congrFun
|
| 77 |
+
(by intro x; exact chunks_eq x.1 x.2 (source x.1))
|
| 78 |
+
|
| 79 |
+
noncomputable opaque orderedEntryProgram :
|
| 80 |
+
Procedure (prodCode unaryCode circuitCode) (listCode descriptorCode)
|
| 81 |
+
(fun x => bucket x.2 x.1) :=
|
| 82 |
+
bucketProgram.comp ((Procedure.second unaryCode circuitCode).pair
|
| 83 |
+
(Procedure.unaryToBits.comp (Procedure.first unaryCode circuitCode)))
|
| 84 |
+
|
| 85 |
+
noncomputable opaque orderedProgram : Procedure circuitCode (listCode descriptorCode) ordered :=
|
| 86 |
+
((QuantumRawExchange.flattenProgram descriptorCode (0,0)).comp
|
| 87 |
+
((Procedure.tabulate (f := fun c i => bucket c i) [] orderedEntryProgram).comp
|
| 88 |
+
(timeProgram.pair (Procedure.identity circuitCode)))).congrFun (by
|
| 89 |
+
intro c
|
| 90 |
+
simp only [ordered,List.flatMap_def,Function.comp_apply,id_eq])
|
| 91 |
+
|
| 92 |
+
noncomputable def orderedCertificate : Turing.TM2ComputableInPolyTime circuitCode
|
| 93 |
+
(listCode descriptorCode) ordered := orderedProgram.toTM2
|
| 94 |
+
|
| 95 |
+
end ContinuumCoulomb.QuantumHistoryDescriptors
|
| 96 |
+
|
| 97 |
+
end
|
| 98 |
+
|
| 99 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedDescriptors.lean
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumHistoryDescriptorProgram
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Numeric time grouping agrees with the exact ordered reference family.
|
| 6 |
+
The first-use time is computed from the actual gate list. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb.QuantumHistoryDescriptors
|
| 10 |
+
open ExactQuantumFactoring.BitStackProgram QuantumCircuitCode
|
| 11 |
+
|
| 12 |
+
def timeValue (c : QMACircuit) (a : Descriptor) : ℕ :=
|
| 13 |
+
if a.1=0 then min a.2 (c.gates.length-1) else
|
| 14 |
+
if a.1=1 then (if a.2=0 then 0 else c.gates.length-1) else
|
| 15 |
+
if a.1=2 then min (QuantumFirstUseProgram.value (c,a.2)) (c.gates.length-1) else
|
| 16 |
+
if a.1=3 then c.gates.length-1 else a.2
|
| 17 |
+
|
| 18 |
+
theorem time_encode (c : QMACircuit) (hT : 0<c.gates.length) (a : QMACircuitTerm c) :
|
| 19 |
+
timeValue c (encode c a) =
|
| 20 |
+
(qmaHistoryTermTime c hT (qmaFirstUseTime c) a).val := by
|
| 21 |
+
rcases a with i | (b | (i | (u | t)))
|
| 22 |
+
· rfl
|
| 23 |
+
· fin_cases b
|
| 24 |
+
· simp only [timeValue,encode,qmaHistoryTermTime]
|
| 25 |
+
norm_num
|
| 26 |
+
· simp only [timeValue,encode,qmaHistoryTermTime,qmaBoundedClockTime]
|
| 27 |
+
have he : min c.gates.length (c.gates.length-1)=c.gates.length-1 :=
|
| 28 |
+
min_eq_right (Nat.sub_le _ _)
|
| 29 |
+
norm_num [he]
|
| 30 |
+
· simp only [timeValue,encode,qmaHistoryTermTime,qmaBoundedClockTime]
|
| 31 |
+
norm_num only
|
| 32 |
+
rw [QuantumFirstUseProgram.value_eq]
|
| 33 |
+
rfl
|
| 34 |
+
· cases u
|
| 35 |
+
simp only [timeValue,encode,qmaHistoryTermTime,qmaBoundedClockTime]
|
| 36 |
+
have he : min c.gates.length (c.gates.length-1)=c.gates.length-1 :=
|
| 37 |
+
min_eq_right (Nat.sub_le _ _)
|
| 38 |
+
norm_num [he]
|
| 39 |
+
· simp only [timeValue,encode,qmaHistoryTermTime]
|
| 40 |
+
norm_num
|
| 41 |
+
|
| 42 |
+
def bucket (c : QMACircuit) (t : ℕ) : List Descriptor :=
|
| 43 |
+
(source c).filter (fun a => decide (timeValue c a=t))
|
| 44 |
+
|
| 45 |
+
def ordered (c : QMACircuit) : List Descriptor :=
|
| 46 |
+
(List.range c.gates.length).flatMap (bucket c)
|
| 47 |
+
|
| 48 |
+
theorem bucket_actual (c : QMACircuit) (hT : 0<c.gates.length)
|
| 49 |
+
(t : Fin c.gates.length) :
|
| 50 |
+
bucket c t.val =
|
| 51 |
+
((qmaHistoryTermList c).filter
|
| 52 |
+
(fun a => decide (qmaHistoryTermTime c hT (qmaFirstUseTime c) a=t))).map
|
| 53 |
+
(encode c) := by
|
| 54 |
+
rw [bucket,source_actual,List.filter_map]
|
| 55 |
+
congr 1
|
| 56 |
+
apply List.filter_congr
|
| 57 |
+
intro a _
|
| 58 |
+
change decide (timeValue c (encode c a)=t.val) = _
|
| 59 |
+
rw [time_encode c hT]
|
| 60 |
+
simp only [Fin.ext_iff]
|
| 61 |
+
|
| 62 |
+
theorem ordered_actual (c : QMACircuit) (hT : 0<c.gates.length) :
|
| 63 |
+
ordered c=(qmaOrderedHistoryTerms c hT (qmaFirstUseTime c)).map (encode c) := by
|
| 64 |
+
unfold ordered qmaOrderedHistoryTerms qmaGroupByTime
|
| 65 |
+
rw [List.map_flatMap]
|
| 66 |
+
have hr : List.range c.gates.length =
|
| 67 |
+
(List.ofFn (fun t : Fin c.gates.length => t)).map Fin.val := by
|
| 68 |
+
apply List.ext_getElem
|
| 69 |
+
· simp
|
| 70 |
+
· intro i hi hj
|
| 71 |
+
simp only [List.getElem_range,List.getElem_map,List.getElem_ofFn]
|
| 72 |
+
rw [hr,List.flatMap_map]
|
| 73 |
+
apply List.flatMap_congr
|
| 74 |
+
intro t _
|
| 75 |
+
exact bucket_actual c hT t
|
| 76 |
+
|
| 77 |
+
theorem ordered_length (c : QMACircuit) (hT : 0<c.gates.length) :
|
| 78 |
+
(ordered c).length=qmaHistoryReferenceWork c+1 := by
|
| 79 |
+
rw [ordered_actual c hT,List.length_map,qmaOrderedHistoryTerms_length]
|
| 80 |
+
|
| 81 |
+
theorem ordered_get (c : QMACircuit) (hT : 0<c.gates.length)
|
| 82 |
+
(i : Fin (qmaHistoryReferenceWork c+1)) :
|
| 83 |
+
(ordered c)[i.val]'(by rw [ordered_length c hT]; exact i.isLt) =
|
| 84 |
+
encode c (qmaOrderedTermEquiv c hT (qmaFirstUseTime c) i) := by
|
| 85 |
+
simp only [ordered_actual c hT,List.getElem_map,qmaOrderedTermEquiv_get]
|
| 86 |
+
|
| 87 |
+
end ContinuumCoulomb.QuantumHistoryDescriptors
|
| 88 |
+
|
| 89 |
+
end
|
| 90 |
+
|
| 91 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedFinalBounds.lean
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedWeightBounds
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelCompile
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! An integer polynomial bound for the complete six-stage ordered compiler,
|
| 7 |
+
including the private-pair subdivision before the physical four-spin step. -/
|
| 8 |
+
|
| 9 |
+
noncomputable section
|
| 10 |
+
namespace ContinuumCoulomb.QuantumOrderedXZ
|
| 11 |
+
open scoped Classical
|
| 12 |
+
|
| 13 |
+
def weightNat (R B : ℕ) : ℕ := R^3+R^2*B+R^2+R*(1+B^2)+1+B^2
|
| 14 |
+
def scaleNat (m B N : ℕ) : ℕ := 8*(4*(1+m*(1+B)^2))^4*N
|
| 15 |
+
def stepNat (m B N : ℕ) : ℕ := weightNat (scaleNat m B N) B
|
| 16 |
+
def pipelineNat (m B N : ℕ) : ℕ → ℕ
|
| 17 |
+
| 0 => B
|
| 18 |
+
| k+1 => stepNat (3136*m) (pipelineNat m B N k) N
|
| 19 |
+
|
| 20 |
+
theorem weightNat_cast (R B : ℕ) : (weightNat R B:ℚ)=weightEnvelope R B := by
|
| 21 |
+
simp only [weightNat,weightEnvelope,Nat.cast_add,Nat.cast_mul,Nat.cast_pow,
|
| 22 |
+
Nat.cast_one]
|
| 23 |
+
|
| 24 |
+
theorem scaleNat_cast (m B N : ℕ) : (scaleNat m B N:ℚ)=scaleEnvelope m B N := by
|
| 25 |
+
simp only [scaleNat,scaleEnvelope,Nat.cast_add,Nat.cast_mul,Nat.cast_pow,
|
| 26 |
+
Nat.cast_one,Nat.cast_ofNat]
|
| 27 |
+
|
| 28 |
+
theorem stepNat_cast (m B N : ℕ) : (stepNat m B N:ℚ)=stepEnvelope m B N := by
|
| 29 |
+
simp only [stepNat,stepEnvelope,weightNat_cast,scaleNat_cast]
|
| 30 |
+
|
| 31 |
+
theorem pipelineNat_cast (m B N k : ℕ) : (pipelineNat m B N k:ℚ)=pipelineBound m B N k := by
|
| 32 |
+
induction k with
|
| 33 |
+
| zero => rfl
|
| 34 |
+
| succ k ih => simp only [pipelineNat,stepNat_cast,ih,pipelineBound]
|
| 35 |
+
|
| 36 |
+
theorem outputTerm_card {κ : Type} [Fintype κ] :
|
| 37 |
+
Fintype.card (OutputTerm κ)=3136*Fintype.card κ := by
|
| 38 |
+
simp only [OutputTerm,XZThreeTerm,TwoTerm,ThreeTerm,Fintype.card_prod,Fintype.card_fin]
|
| 39 |
+
ring
|
| 40 |
+
|
| 41 |
+
theorem private_coefficient_bound {κ : Type} [Fintype κ] (J : κ → ℚ)
|
| 42 |
+
{m B : ℕ} (hm : Fintype.card κ ≤ m) (hJ : ∀ e, |J e| ≤ (B:ℚ))
|
| 43 |
+
(N : ℕ) (p : OutputTerm κ × Fin 4) :
|
| 44 |
+
|QuantumOrderedPrivate.outputCoefficient (coefficient J N) N p| ≤
|
| 45 |
+
(pipelineNat m B N 6:ℚ) := by
|
| 46 |
+
have hB : (0:ℚ) ≤ B := Nat.cast_nonneg B
|
| 47 |
+
have hc := pipeline_coefficient_bound J hB hm hJ N
|
| 48 |
+
have hcount : Fintype.card (OutputTerm κ) ≤ 3136*m := by
|
| 49 |
+
rw [outputTerm_card]
|
| 50 |
+
exact Nat.mul_le_mul_left 3136 hm
|
| 51 |
+
have h := subdivision_coefficient_bound (coefficient J N)
|
| 52 |
+
(pipelineBound_nonneg m hB N 5) hcount hc N p
|
| 53 |
+
change |QuantumOrderedSubdivision.outputCoefficient (coefficient J N) N p| ≤
|
| 54 |
+
(stepNat (3136*m) (pipelineNat m B N 5) N:ℚ)
|
| 55 |
+
rw [stepNat_cast,pipelineNat_cast]
|
| 56 |
+
exact h
|
| 57 |
+
|
| 58 |
+
end ContinuumCoulomb.QuantumOrderedXZ
|
| 59 |
+
|
| 60 |
+
end
|
| 61 |
+
|
| 62 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedHistory.lean
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedReference
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Reordering actual history terms preserves the full-space reference gap. -/
|
| 6 |
+
|
| 7 |
+
noncomputable section
|
| 8 |
+
namespace ContinuumCoulomb
|
| 9 |
+
open Matrix
|
| 10 |
+
open scoped BigOperators Classical
|
| 11 |
+
|
| 12 |
+
def qmaOrderedReferenceTerms (c : QMACircuit) (hT : 0 < c.gates.length)
|
| 13 |
+
(τ : Fin (c.work+1) → Fin (c.gates.length+1))
|
| 14 |
+
(i : Fin (qmaHistoryReferenceWork c+1)) :=
|
| 15 |
+
qmaDistributedTermMatrix c τ (qmaOrderedTermEquiv c hT τ i)
|
| 16 |
+
|
| 17 |
+
theorem qmaOrderedReferenceTerms_sum (c : QMACircuit) (hT : 0 < c.gates.length)
|
| 18 |
+
(τ : Fin (c.work+1) → Fin (c.gates.length+1)) :
|
| 19 |
+
(∑ i, qmaOrderedReferenceTerms c hT τ i) = qmaDistributedQubitHamiltonian c τ := by
|
| 20 |
+
unfold qmaOrderedReferenceTerms
|
| 21 |
+
rw [(qmaOrderedTermEquiv c hT τ).sum_comp,qmaDistributedTerm_sum]
|
| 22 |
+
|
| 23 |
+
def qmaOrderedReferenceHistory (c : QMACircuit) (hT : 0 < c.gates.length)
|
| 24 |
+
(τ : Fin (c.work+1) → Fin (c.gates.length+1)) :
|
| 25 |
+
Matrix (QMAHistoryReferenceBasis c) (QMAHistoryReferenceBasis c) ℂ :=
|
| 26 |
+
qmaReferenceFamily (qmaHistoryReferenceWork c) (qmaOrderedReferenceTerms c hT τ) 1
|
| 27 |
+
|
| 28 |
+
theorem qmaOrderedReferenceHistory_lower (c : QMACircuit) (hc : c.WellFormed)
|
| 29 |
+
(hT : 0 < c.gates.length) (τ : Fin (c.work+1) → Fin (c.gates.length+1))
|
| 30 |
+
(hi : ∀ i, ∀ g ∈ c.gates.take (τ i).val, i ∉ qmaGateSites c.work g)
|
| 31 |
+
(hsound : ∀ psi : EuclideanSpace ℂ (SourceSpinBasis c.witness),
|
| 32 |
+
‖psi‖ = 1 → qmaAcceptance c hc psi ≤ 1/3)
|
| 33 |
+
(u : QMAHistoryReferenceBasis c → ℂ) :
|
| 34 |
+
(2/(5*(c.gates.length+1:ℝ)))*(∑ p, Complex.normSq (u p)) ≤
|
| 35 |
+
qmaQuadratic (qmaOrderedReferenceHistory c hT τ) u := by
|
| 36 |
+
have hd : 0 < 5*(c.gates.length+1:ℝ) := by positivity
|
| 37 |
+
have ha : (2:ℝ)/(5*(c.gates.length+1:ℝ)) ≤ 1 := by
|
| 38 |
+
apply (div_le_one hd).mpr
|
| 39 |
+
have : (0:ℝ) ≤ c.gates.length := Nat.cast_nonneg _
|
| 40 |
+
linarith
|
| 41 |
+
apply qmaReferenceFamily_lower _ _ (fun i => qmaDistributedTerm_nonnegative c τ _) _ _
|
| 42 |
+
(by positivity) ha
|
| 43 |
+
intro v
|
| 44 |
+
change _ ≤ qmaQuadratic (∑ i, qmaOrderedReferenceTerms c hT τ i) v
|
| 45 |
+
rw [qmaOrderedReferenceTerms_sum]
|
| 46 |
+
exact qmaDistributedQubit_lower c hc τ hi hsound v
|
| 47 |
+
|
| 48 |
+
theorem qmaOrderedReferenceHistory_accepting (c : QMACircuit) (hc : c.WellFormed)
|
| 49 |
+
(hT : 0 < c.gates.length) (τ : Fin (c.work+1) → Fin (c.gates.length+1))
|
| 50 |
+
(hi : ∀ i, ∀ g ∈ c.gates.take (τ i).val, i ∉ qmaGateSites c.work g)
|
| 51 |
+
(psi : EuclideanSpace ℂ (SourceSpinBasis c.witness)) (hpsi : ‖psi‖ = 1)
|
| 52 |
+
(hacc : 2/3 ≤ qmaAcceptance c hc psi) :
|
| 53 |
+
∃ u : QMAHistoryReferenceBasis c → ℂ, (∑ p, Complex.normSq (u p)) = 1 ∧
|
| 54 |
+
3*(c.gates.length+1:ℝ)*qmaQuadratic (qmaOrderedReferenceHistory c hT τ) u ≤ 1 := by
|
| 55 |
+
obtain ⟨v,hv,he⟩ := qmaDistributedQubit_accepting c hc τ hi psi hpsi hacc
|
| 56 |
+
refine ⟨qmaReferenceTrial (qmaHistoryReferenceWork c) v,?_,?_⟩
|
| 57 |
+
· rw [qmaReferenceTrial_mass]
|
| 58 |
+
exact hv
|
| 59 |
+
· unfold qmaOrderedReferenceHistory
|
| 60 |
+
rw [qmaReferenceTrial_energy,qmaOrderedReferenceTerms_sum]
|
| 61 |
+
exact he
|
| 62 |
+
|
| 63 |
+
end ContinuumCoulomb
|
| 64 |
+
|
| 65 |
+
end
|
| 66 |
+
|
| 67 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedIncidence.lean
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedXZPipeline
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedPrivate
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Uniform incidence bounds for the actual ordered local reductions. Every
|
| 7 |
+
new site belongs to one input term, while old sites remain in that term's
|
| 8 |
+
stored support. The bound counts zero-coefficient terms as well. -/
|
| 9 |
+
|
| 10 |
+
noncomputable section
|
| 11 |
+
namespace ContinuumCoulomb.QuantumOrderedIncidence
|
| 12 |
+
open scoped BigOperators Classical
|
| 13 |
+
|
| 14 |
+
variable {ι κ : Type} [Fintype κ]
|
| 15 |
+
|
| 16 |
+
def count (xs : κ → List ι) (q : ι) : ℕ :=
|
| 17 |
+
∑ e, if q ∈ xs e then 1 else 0
|
| 18 |
+
|
| 19 |
+
def Bounded (xs : κ → List ι) (D : ℕ) : Prop := ∀ q, count xs q ≤ D
|
| 20 |
+
|
| 21 |
+
def Origin (xs : κ → List ι) (e : κ) : ι ⊕ κ → Prop :=
|
| 22 |
+
Sum.elim (fun q => q ∈ xs e) (fun f => f = e)
|
| 23 |
+
|
| 24 |
+
theorem extension_bound {d D : ℕ} (xs : κ → List ι)
|
| 25 |
+
(ys : κ × Fin d → List (ι ⊕ κ)) (hD : 1 ≤ D) (hx : Bounded xs D)
|
| 26 |
+
(hy : ∀ p q, q ∈ ys p → Origin xs p.1 q) : Bounded ys (d*D) := by
|
| 27 |
+
intro q
|
| 28 |
+
cases q with
|
| 29 |
+
| inl q =>
|
| 30 |
+
calc
|
| 31 |
+
count ys (Sum.inl q) ≤ ∑ p : κ × Fin d, if q ∈ xs p.1 then 1 else 0 := by
|
| 32 |
+
apply Finset.sum_le_sum
|
| 33 |
+
intro p _
|
| 34 |
+
by_cases h : Sum.inl q ∈ ys p
|
| 35 |
+
· have ho : q ∈ xs p.1 := hy p _ h
|
| 36 |
+
simp only [h,ho,ite_true,le_refl]
|
| 37 |
+
· simp only [h,ite_false,Nat.zero_le]
|
| 38 |
+
_ = d*count xs q := by
|
| 39 |
+
rw [Fintype.sum_prod_type]
|
| 40 |
+
have hi (e : κ) : (∑ _k : Fin d, if q ∈ xs e then 1 else 0) =
|
| 41 |
+
d*(if q ∈ xs e then 1 else 0) := by
|
| 42 |
+
by_cases h : q ∈ xs e <;> simp [h]
|
| 43 |
+
simp_rw [hi]
|
| 44 |
+
exact (Finset.mul_sum _ _ _).symm
|
| 45 |
+
_ ≤ d*D := Nat.mul_le_mul_left d (hx q)
|
| 46 |
+
| inr q =>
|
| 47 |
+
calc
|
| 48 |
+
count ys (Sum.inr q) ≤ ∑ p : κ × Fin d, if q=p.1 then 1 else 0 := by
|
| 49 |
+
apply Finset.sum_le_sum
|
| 50 |
+
intro p _
|
| 51 |
+
by_cases h : Sum.inr q ∈ ys p
|
| 52 |
+
· have ho : q=p.1 := hy p _ h
|
| 53 |
+
rw [ite_eq_left h,ite_eq_left ho]
|
| 54 |
+
· simp only [h,ite_false,Nat.zero_le]
|
| 55 |
+
_ = d := by
|
| 56 |
+
rw [Fintype.sum_prod_type]
|
| 57 |
+
have hi (e : κ) : (∑ _k : Fin d, if q=e then 1 else 0) =
|
| 58 |
+
if q=e then d else 0 := by
|
| 59 |
+
by_cases h : q=e <;> simp [h]
|
| 60 |
+
simp_rw [hi]
|
| 61 |
+
simp
|
| 62 |
+
_ ≤ d*D := by simpa only [Nat.mul_one] using Nat.mul_le_mul_left d hD
|
| 63 |
+
|
| 64 |
+
omit [Fintype κ] in
|
| 65 |
+
theorem append_origin (xs : κ → List ι) (e : κ) (zs : List ι)
|
| 66 |
+
(hz : ∀ q ∈ zs, q ∈ xs e) (q : ι ⊕ κ)
|
| 67 |
+
(hq : q ∈ QuantumOrderedSubdivision.appendMediator zs e) : Origin xs e q := by
|
| 68 |
+
cases q with
|
| 69 |
+
| inl q =>
|
| 70 |
+
exact hz q (by simpa only [QuantumOrderedSubdivision.appendMediator,
|
| 71 |
+
List.mem_append,List.mem_map,Sum.inl.injEq,exists_eq_right,List.mem_singleton,
|
| 72 |
+
Sum.inl_ne_inr,or_false] using hq)
|
| 73 |
+
| inr q =>
|
| 74 |
+
simpa only [Origin,Sum.elim_inr,QuantumOrderedSubdivision.appendMediator,
|
| 75 |
+
List.mem_append,List.mem_map,Sum.inl_ne_inr,and_false,exists_false,List.mem_singleton,
|
| 76 |
+
Sum.inr.injEq,false_or] using hq
|
| 77 |
+
|
| 78 |
+
omit [Fintype κ] in
|
| 79 |
+
theorem subdivision_origin (xs : κ → List ι) (d : ℕ)
|
| 80 |
+
(p : κ × Fin 4) (q : ι ⊕ κ)
|
| 81 |
+
(hq : q ∈ QuantumOrderedSubdivision.outputSites xs d p) : Origin xs p.1 q := by
|
| 82 |
+
rcases p with ⟨e,k⟩
|
| 83 |
+
fin_cases k
|
| 84 |
+
· simp [QuantumOrderedSubdivision.outputSites] at hq
|
| 85 |
+
· have he : q=Sum.inr e := by simpa [QuantumOrderedSubdivision.outputSites] using hq
|
| 86 |
+
subst q
|
| 87 |
+
rfl
|
| 88 |
+
· exact append_origin xs e _ (fun _ h => List.mem_of_mem_take h) q hq
|
| 89 |
+
· exact append_origin xs e _ (fun _ h => List.mem_of_mem_drop h) q hq
|
| 90 |
+
|
| 91 |
+
theorem subdivision_bound {D : ℕ} (xs : κ → List ι) (d : ℕ)
|
| 92 |
+
(hD : 1 ≤ D) (hx : Bounded xs D) :
|
| 93 |
+
Bounded (QuantumOrderedSubdivision.outputSites xs d) (4*D) :=
|
| 94 |
+
extension_bound xs _ hD hx (subdivision_origin xs d)
|
| 95 |
+
|
| 96 |
+
omit [Fintype κ] in
|
| 97 |
+
theorem yy_origin (xs : κ → List ι) (p : κ × Fin 4) (q : ι ⊕ κ)
|
| 98 |
+
(hq : q ∈ QuantumOrderedYY.outputSites xs p) : Origin xs p.1 q := by
|
| 99 |
+
rcases p with ⟨e,k⟩
|
| 100 |
+
fin_cases k
|
| 101 |
+
· simp [QuantumOrderedYY.outputSites] at hq
|
| 102 |
+
· have he : q=Sum.inr e := by simpa [QuantumOrderedYY.outputSites] using hq
|
| 103 |
+
subst q
|
| 104 |
+
rfl
|
| 105 |
+
· exact append_origin xs e _ (fun _ h => h) q hq
|
| 106 |
+
· exact append_origin xs e _ (fun _ h => h) q hq
|
| 107 |
+
|
| 108 |
+
theorem yy_bound [Fintype ι] [DecidableEq ι] [DecidableEq κ]
|
| 109 |
+
{D : ℕ} (xs : κ → List ι) (hD : 1 ≤ D) (hx : Bounded xs D) :
|
| 110 |
+
Bounded (QuantumOrderedYY.outputSites xs) (4*D) :=
|
| 111 |
+
extension_bound xs _ hD hx (yy_origin xs)
|
| 112 |
+
|
| 113 |
+
omit [Fintype κ] in
|
| 114 |
+
theorem third_origin (xs : κ → List ι) (w : κ → ι → Fin 4)
|
| 115 |
+
(hlen : ∀ e, (xs e).length ≤ 3) (p : κ × Fin 7) (q : ι ⊕ κ)
|
| 116 |
+
(hq : q ∈ QuantumOrderedThird.outputSites xs w p) : Origin xs p.1 q := by
|
| 117 |
+
rcases p with ⟨e,k⟩
|
| 118 |
+
have hp : ∀ i ∈ (QuantumOrderedTriple.partition (xs e) (w e)).1, i ∈ xs e := by
|
| 119 |
+
intro i hi
|
| 120 |
+
exact (QuantumOrderedTriple.partition_spec (xs e) (w e) (hlen e)).1.mem_iff.mp
|
| 121 |
+
(List.mem_append_left _ hi)
|
| 122 |
+
have hr : ∀ i ∈ (QuantumOrderedTriple.partition (xs e) (w e)).2, i ∈ xs e := by
|
| 123 |
+
intro i hi
|
| 124 |
+
exact (QuantumOrderedTriple.partition_spec (xs e) (w e) (hlen e)).1.mem_iff.mp
|
| 125 |
+
(List.mem_append_right _ hi)
|
| 126 |
+
fin_cases k
|
| 127 |
+
· simp [QuantumOrderedThird.outputSites] at hq
|
| 128 |
+
· have he : q=Sum.inr e := by simpa [QuantumOrderedThird.outputSites] using hq
|
| 129 |
+
subst q
|
| 130 |
+
rfl
|
| 131 |
+
· obtain ⟨i,hi,rfl⟩ := List.mem_map.mp hq
|
| 132 |
+
exact hp i hi
|
| 133 |
+
· obtain ⟨i,hi,rfl⟩ := List.mem_map.mp hq
|
| 134 |
+
exact hr i hi
|
| 135 |
+
· exact append_origin xs e _ hr q hq
|
| 136 |
+
· exact append_origin xs e _ (fun i h => hp i (List.mem_of_mem_take h)) q hq
|
| 137 |
+
· exact append_origin xs e _ (fun i h => hp i (List.mem_of_mem_drop h)) q hq
|
| 138 |
+
|
| 139 |
+
theorem third_bound [Fintype ι] [DecidableEq ι] [DecidableEq κ]
|
| 140 |
+
{D : ℕ} (xs : κ → List ι) (w : κ → ι → Fin 4)
|
| 141 |
+
(hlen : ∀ e, (xs e).length ≤ 3) (hD : 1 ≤ D) (hx : Bounded xs D) :
|
| 142 |
+
Bounded (QuantumOrderedThird.outputSites xs w) (7*D) :=
|
| 143 |
+
extension_bound xs _ hD hx (third_origin xs w hlen)
|
| 144 |
+
|
| 145 |
+
theorem xz_bound [Fintype ι] [DecidableEq ι] [DecidableEq κ]
|
| 146 |
+
{D : ℕ} (xs : κ → List ι) (w : κ → ι → Fin 4)
|
| 147 |
+
(hlen : ∀ e, (xs e).length ≤ 6) (hD : 1 ≤ D) (hx : Bounded xs D) :
|
| 148 |
+
Bounded (QuantumOrderedXZ.sites xs w) (3136*D) := by
|
| 149 |
+
have h1 := subdivision_bound xs 3 hD hx
|
| 150 |
+
have h2 := subdivision_bound (QuantumOrderedSubdivision.outputSites xs 3) 2
|
| 151 |
+
(by omega : 1 ≤ 4*D) h1
|
| 152 |
+
have h3 := third_bound (QuantumOrderedXZ.threeSites xs) (QuantumOrderedXZ.threeWord xs w)
|
| 153 |
+
(QuantumOrderedXZ.threeSites_length xs hlen) (by omega : 1 ≤ 4*(4*D)) h2
|
| 154 |
+
have h4 := yy_bound (QuantumOrderedXZ.twoSites xs w) (by omega : 1 ≤ 7*(4*(4*D))) h3
|
| 155 |
+
have h5 := third_bound (QuantumOrderedXZ.xzThreeSites xs w)
|
| 156 |
+
(QuantumOrderedXZ.xzThreeWord xs w) (QuantumOrderedXZ.xzThreeSites_length xs w hlen)
|
| 157 |
+
(by omega : 1 ≤ 4*(7*(4*(4*D)))) h4
|
| 158 |
+
change Bounded (QuantumOrderedXZ.sites xs w) (7*(4*(7*(4*(4*D))))) at h5
|
| 159 |
+
convert h5 using 1
|
| 160 |
+
omega
|
| 161 |
+
|
| 162 |
+
theorem private_bound [Fintype ι] [DecidableEq ι] [DecidableEq κ]
|
| 163 |
+
{D : ℕ} (xs : κ → List ι) (hD : 1 ≤ D) (hx : Bounded xs D) :
|
| 164 |
+
Bounded (QuantumOrderedPrivate.outputSites xs) (4*D) :=
|
| 165 |
+
subdivision_bound xs 1 hD hx
|
| 166 |
+
|
| 167 |
+
theorem complete_bound [Fintype ι] [DecidableEq ι] [DecidableEq κ]
|
| 168 |
+
{D : ℕ} (xs : κ → List ι) (w : κ → ι → Fin 4)
|
| 169 |
+
(hlen : ∀ e, (xs e).length ≤ 6) (hD : 1 ≤ D) (hx : Bounded xs D) :
|
| 170 |
+
Bounded (QuantumOrderedPrivate.outputSites (QuantumOrderedXZ.sites xs w)) (12544*D) := by
|
| 171 |
+
have h := private_bound (QuantumOrderedXZ.sites xs w)
|
| 172 |
+
(by omega : 1 ≤ 3136*D) (xz_bound xs w hlen hD hx)
|
| 173 |
+
convert h using 1
|
| 174 |
+
omega
|
| 175 |
+
|
| 176 |
+
end ContinuumCoulomb.QuantumOrderedIncidence
|
| 177 |
+
|
| 178 |
+
end
|
| 179 |
+
|
| 180 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelBlocks.lean
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelYY
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelProgram
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Literal fixed-size programs for the triple partition and YY/private
|
| 7 |
+
blocks. The branch tests inspect only the stored support labels. -/
|
| 8 |
+
|
| 9 |
+
noncomputable section
|
| 10 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelData
|
| 11 |
+
open ExactQuantumFactoring.BitStackProgram
|
| 12 |
+
|
| 13 |
+
noncomputable opaque entryProgram (k : ℕ) : Procedure labelsCode labelCode
|
| 14 |
+
(fun xs => (xs.drop k).headD (0,0)) :=
|
| 15 |
+
(Procedure.listGet labelCode (0,0)).comp
|
| 16 |
+
((Procedure.constant labelsCode Nat.bits k).pair (Procedure.identity labelsCode))
|
| 17 |
+
noncomputable opaque labelTest (k a : ℕ) : Procedure labelsCode Procedure.boolCode
|
| 18 |
+
(fun xs => decide (((xs.drop k).headD (0,0)).2=a)) :=
|
| 19 |
+
Procedure.binaryEq.comp (((Procedure.second Nat.bits Nat.bits).comp (entryProgram k)).pair
|
| 20 |
+
(Procedure.constant labelsCode Nat.bits a))
|
| 21 |
+
noncomputable opaque lengthTest (n : ℕ) : Procedure labelsCode Procedure.boolCode
|
| 22 |
+
(fun xs => decide (xs.length=n)) :=
|
| 23 |
+
Procedure.binaryEq.comp ((Procedure.unaryToBits.comp
|
| 24 |
+
(ExactQuantumFactoring.NativeAIG.Emission.listUnaryLength labelCode (0,0))).pair
|
| 25 |
+
(Procedure.constant labelsCode Nat.bits n))
|
| 26 |
+
|
| 27 |
+
private def selected (a b : ℕ) (xs : List Letter) : List Letter :=
|
| 28 |
+
[(xs.drop a).headD (0,0),(xs.drop b).headD (0,0)]
|
| 29 |
+
private noncomputable def selectedProgram (a b : ℕ) : Procedure labelsCode labelsCode
|
| 30 |
+
(selected a b) :=
|
| 31 |
+
(Procedure.listCons labelCode).comp ((entryProgram a).pair
|
| 32 |
+
(singletonProgram _ (entryProgram b)))
|
| 33 |
+
|
| 34 |
+
private def partitionLookup (xs : List Letter) : List Letter × List Letter :=
|
| 35 |
+
if xs.length=3 then
|
| 36 |
+
if ((xs.drop 0).headD (0,0)).2=2 then
|
| 37 |
+
if ((xs.drop 1).headD (0,0)).2=2 then
|
| 38 |
+
(selected 0 1 xs,[(xs.drop 2).headD (0,0)])
|
| 39 |
+
else (selected 0 2 xs,[(xs.drop 1).headD (0,0)])
|
| 40 |
+
else (selected 1 2 xs,[(xs.drop 0).headD (0,0)])
|
| 41 |
+
else (xs,[])
|
| 42 |
+
|
| 43 |
+
private theorem partitionLookup_eq (xs : List Letter) : partitionLookup xs=partition xs := by
|
| 44 |
+
cases xs with
|
| 45 |
+
| nil => rfl
|
| 46 |
+
| cons a xs =>
|
| 47 |
+
cases xs with
|
| 48 |
+
| nil => rfl
|
| 49 |
+
| cons b xs =>
|
| 50 |
+
cases xs with
|
| 51 |
+
| nil => rfl
|
| 52 |
+
| cons c xs =>
|
| 53 |
+
cases xs with
|
| 54 |
+
| nil => simp [partitionLookup,partition,selected]
|
| 55 |
+
| cons d xs => simp [partitionLookup,partition,List.length_cons]
|
| 56 |
+
|
| 57 |
+
noncomputable opaque partitionProgram :
|
| 58 |
+
Procedure labelsCode (prodCode labelsCode labelsCode) partition := by
|
| 59 |
+
let p01 := (selectedProgram 0 1).pair (singletonProgram _ (entryProgram 2))
|
| 60 |
+
let p02 := (selectedProgram 0 2).pair (singletonProgram _ (entryProgram 1))
|
| 61 |
+
let p12 := (selectedProgram 1 2).pair (singletonProgram _ (entryProgram 0))
|
| 62 |
+
let p := Procedure.conditional (lengthTest 3)
|
| 63 |
+
(Procedure.conditional (labelTest 0 2) (Procedure.conditional (labelTest 1 2) p01 p02) p12)
|
| 64 |
+
((Procedure.identity labelsCode).pair (Procedure.constant labelsCode labelsCode []))
|
| 65 |
+
exact p.congrFun (by
|
| 66 |
+
intro xs
|
| 67 |
+
simpa only [partitionLookup,decide_eq_true_eq,id_eq] using partitionLookup_eq xs)
|
| 68 |
+
|
| 69 |
+
noncomputable opaque pairLabelsProgram : Procedure blockCode labelsCode
|
| 70 |
+
(fun x => (partition x.2).1) :=
|
| 71 |
+
((Procedure.first labelsCode labelsCode).comp partitionProgram).comp labelsProgram
|
| 72 |
+
noncomputable opaque realLabelsProgram : Procedure blockCode labelsCode
|
| 73 |
+
(fun x => (partition x.2).2) :=
|
| 74 |
+
((Procedure.second labelsCode labelsCode).comp partitionProgram).comp labelsProgram
|
| 75 |
+
noncomputable opaque thirdMediatorProgram : Procedure blockCode labelCode
|
| 76 |
+
(fun x => (x.1,axis ((partition x.2).1.take 1))) :=
|
| 77 |
+
mediatorProgram.pair (axisProgram.comp ((takeProgram 1).comp pairLabelsProgram))
|
| 78 |
+
|
| 79 |
+
noncomputable opaque thirdBlockProgram (k : Fin 7) :
|
| 80 |
+
Procedure blockCode labelsCode (fun x => thirdBlock x.1 x.2 k) := by
|
| 81 |
+
refine Fin.cases ?_ (fun k => ?_) k
|
| 82 |
+
· exact Procedure.constant blockCode labelsCode []
|
| 83 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 84 |
+
· exact singletonProgram (fun x : BlockInput => (x.1,3))
|
| 85 |
+
(mediatorProgram.pair (Procedure.constant blockCode Nat.bits 3))
|
| 86 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 87 |
+
· exact pairLabelsProgram
|
| 88 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 89 |
+
· exact realLabelsProgram
|
| 90 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 91 |
+
· exact (Procedure.listAppend labelCode (0,0)).comp
|
| 92 |
+
(realLabelsProgram.pair (singletonProgram (fun x : BlockInput => (x.1,3))
|
| 93 |
+
(mediatorProgram.pair (Procedure.constant blockCode Nat.bits 3))))
|
| 94 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 95 |
+
· exact (Procedure.listAppend labelCode (0,0)).comp
|
| 96 |
+
(((takeProgram 1).comp pairLabelsProgram).pair
|
| 97 |
+
(singletonProgram _ thirdMediatorProgram))
|
| 98 |
+
· refine Fin.cases ?_ (fun k => Fin.elim0 k) k
|
| 99 |
+
exact (Procedure.listAppend labelCode (0,0)).comp
|
| 100 |
+
(((dropProgram 1).comp pairLabelsProgram).pair
|
| 101 |
+
(singletonProgram _ thirdMediatorProgram))
|
| 102 |
+
|
| 103 |
+
noncomputable opaque zerosProgram : Procedure labelsCode labelsCode zeros :=
|
| 104 |
+
Procedure.listMap (0,0) (0,0) ((Procedure.first Nat.bits Nat.bits).pair
|
| 105 |
+
(Procedure.constant labelCode Nat.bits 0))
|
| 106 |
+
|
| 107 |
+
private def yyLookup (xs : List Letter) : List Letter × List Letter :=
|
| 108 |
+
if xs.length=2 ∧ ((xs.drop 0).headD (0,0)).2=2 then
|
| 109 |
+
([(((xs.drop 0).headD (0,0)).1,1),(((xs.drop 1).headD (0,0)).1,3)],
|
| 110 |
+
[(((xs.drop 0).headD (0,0)).1,3),(((xs.drop 1).headD (0,0)).1,1)])
|
| 111 |
+
else (xs,zeros xs)
|
| 112 |
+
private theorem yyLookup_eq (xs : List Letter) : yyLookup xs=yyFactors xs := by
|
| 113 |
+
cases xs with
|
| 114 |
+
| nil => rfl
|
| 115 |
+
| cons a xs =>
|
| 116 |
+
cases xs with
|
| 117 |
+
| nil => simp [yyLookup,yyFactors]
|
| 118 |
+
| cons b xs =>
|
| 119 |
+
cases xs with
|
| 120 |
+
| nil => simp [yyLookup,yyFactors]
|
| 121 |
+
| cons c xs => simp [yyLookup,yyFactors,List.length_cons]
|
| 122 |
+
|
| 123 |
+
private noncomputable def relabelProgram (k a : ℕ) : Procedure labelsCode labelCode
|
| 124 |
+
(fun xs => (((xs.drop k).headD (0,0)).1,a)) :=
|
| 125 |
+
((Procedure.first Nat.bits Nat.bits).comp (entryProgram k)).pair
|
| 126 |
+
(Procedure.constant labelsCode Nat.bits a)
|
| 127 |
+
private noncomputable def crossedProgram (a b : ℕ) : Procedure labelsCode labelsCode
|
| 128 |
+
(fun xs => [(((xs.drop 0).headD (0,0)).1,a),(((xs.drop 1).headD (0,0)).1,b)]) :=
|
| 129 |
+
(Procedure.listCons labelCode).comp ((relabelProgram 0 a).pair
|
| 130 |
+
(singletonProgram _ (relabelProgram 1 b)))
|
| 131 |
+
noncomputable opaque yyFactorsProgram : Procedure labelsCode (prodCode labelsCode labelsCode)
|
| 132 |
+
yyFactors := by
|
| 133 |
+
let p := Procedure.conditional (Procedure.boolAnd.comp
|
| 134 |
+
((lengthTest 2).pair (labelTest 0 2)))
|
| 135 |
+
((crossedProgram 1 3).pair (crossedProgram 3 1))
|
| 136 |
+
((Procedure.identity labelsCode).pair zerosProgram)
|
| 137 |
+
exact p.congrFun (by
|
| 138 |
+
intro xs
|
| 139 |
+
simpa only [yyLookup,Function.comp_apply,id_eq,Bool.and_eq_true,decide_eq_true_eq]
|
| 140 |
+
using yyLookup_eq xs)
|
| 141 |
+
|
| 142 |
+
noncomputable opaque yyBlockProgram (k : Fin 4) :
|
| 143 |
+
Procedure blockCode labelsCode (fun x => yyBlock x.1 x.2 k) := by
|
| 144 |
+
let med := singletonProgram (fun x : BlockInput => (x.1,1))
|
| 145 |
+
(mediatorProgram.pair (Procedure.constant blockCode Nat.bits 1))
|
| 146 |
+
refine Fin.cases ?_ (fun k => ?_) k
|
| 147 |
+
· exact Procedure.constant blockCode labelsCode []
|
| 148 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 149 |
+
· exact singletonProgram (fun x : BlockInput => (x.1,3))
|
| 150 |
+
(mediatorProgram.pair (Procedure.constant blockCode Nat.bits 3))
|
| 151 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 152 |
+
· exact (Procedure.listAppend labelCode (0,0)).comp
|
| 153 |
+
((((Procedure.first labelsCode labelsCode).comp yyFactorsProgram).comp labelsProgram).pair med)
|
| 154 |
+
· refine Fin.cases ?_ (fun k => Fin.elim0 k) k
|
| 155 |
+
exact (Procedure.listAppend labelCode (0,0)).comp
|
| 156 |
+
((((Procedure.second labelsCode labelsCode).comp yyFactorsProgram).comp labelsProgram).pair med)
|
| 157 |
+
|
| 158 |
+
noncomputable opaque privateBlockProgram (k : Fin 4) :
|
| 159 |
+
Procedure blockCode labelsCode (fun x => privateBlock x.1 x.2 k) := by
|
| 160 |
+
let med := singletonProgram (fun x : BlockInput => (x.1,1))
|
| 161 |
+
(mediatorProgram.pair (Procedure.constant blockCode Nat.bits 1))
|
| 162 |
+
refine Fin.cases ?_ (fun k => ?_) k
|
| 163 |
+
· exact Procedure.constant blockCode labelsCode []
|
| 164 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 165 |
+
· exact singletonProgram (fun x : BlockInput => (x.1,3))
|
| 166 |
+
(mediatorProgram.pair (Procedure.constant blockCode Nat.bits 3))
|
| 167 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 168 |
+
· exact (Procedure.listAppend labelCode (0,0)).comp ((prefixProgram 1).pair med)
|
| 169 |
+
· refine Fin.cases ?_ (fun k => Fin.elim0 k) k
|
| 170 |
+
exact (Procedure.listAppend labelCode (0,0)).comp ((suffixProgram 1).pair med)
|
| 171 |
+
|
| 172 |
+
end ContinuumCoulomb.QuantumOrderedLabelData
|
| 173 |
+
|
| 174 |
+
end
|
| 175 |
+
|
| 176 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelCompile.lean
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelPacking
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedRawPackingProgram
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! The literal six-local sparse-word compiler followed by the rational
|
| 7 |
+
four-spin compiler. Its only input is a precision, a unary qubit count,
|
| 8 |
+
and the ordered rational sparse-word list. -/
|
| 9 |
+
|
| 10 |
+
noncomputable section
|
| 11 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelCompile
|
| 12 |
+
open ExactQuantumFactoring.BitStackProgram QuantumOrderedLabelFamily
|
| 13 |
+
open QuantumOrderedLabelTable
|
| 14 |
+
open scoped Classical
|
| 15 |
+
|
| 16 |
+
abbrev Input := QuantumOrderedLabelFamily.Input
|
| 17 |
+
|
| 18 |
+
def qubitCount (x : Input) : ℕ := 4*(QuantumOrderedLabelPipeline.output x).1
|
| 19 |
+
|
| 20 |
+
def classify (xs : List Entry) : List QuantumRawExchange.Raw :=
|
| 21 |
+
xs.map QuantumOrderedRawPacking.value
|
| 22 |
+
|
| 23 |
+
def labelEntries (x : Input) : List Entry := (QuantumOrderedLabelPipeline.output x).2
|
| 24 |
+
|
| 25 |
+
def rawEntries : Input → List QuantumRawExchange.Raw := classify ∘ labelEntries
|
| 26 |
+
|
| 27 |
+
def outputCount : Input → ℕ := Prod.fst ∘ QuantumOrderedLabelPipeline.output
|
| 28 |
+
|
| 29 |
+
def rawInput (x : Input) : QuantumRawExchange.ScheduleInput :=
|
| 30 |
+
(outputCount x,x.1,rawEntries x)
|
| 31 |
+
|
| 32 |
+
def output : Input → List MediatorListProgram.Bond × ℚ :=
|
| 33 |
+
QuantumRawExchange.compile ∘ rawInput
|
| 34 |
+
|
| 35 |
+
noncomputable opaque classifyProgram : Procedure (listCode entryCode)
|
| 36 |
+
(listCode QuantumRawExchange.rawCode) classify := by
|
| 37 |
+
let p := Procedure.listMap ([],0) QuantumRawExchange.zeroRaw QuantumOrderedRawPacking.program
|
| 38 |
+
exact p.congrEncoding (by intro xs; rfl) (by intro ys; rfl)
|
| 39 |
+
|
| 40 |
+
noncomputable opaque labelEntriesProgram : Procedure inputCode (listCode entryCode)
|
| 41 |
+
labelEntries :=
|
| 42 |
+
(Procedure.second unaryCode (listCode entryCode)).comp
|
| 43 |
+
QuantumOrderedLabelPipeline.outputProgram
|
| 44 |
+
|
| 45 |
+
noncomputable opaque rawEntriesProgram : Procedure inputCode
|
| 46 |
+
(listCode QuantumRawExchange.rawCode) rawEntries :=
|
| 47 |
+
Procedure.comp (f := labelEntries) (g := classify) classifyProgram labelEntriesProgram
|
| 48 |
+
|
| 49 |
+
noncomputable opaque outputCountProgram : Procedure inputCode unaryCode outputCount :=
|
| 50 |
+
(Procedure.first unaryCode (listCode entryCode)).comp QuantumOrderedLabelPipeline.outputProgram
|
| 51 |
+
|
| 52 |
+
noncomputable opaque outputProgram : Procedure inputCode
|
| 53 |
+
(prodCode (listCode MediatorListProgram.bondCode) ratCode) output := by
|
| 54 |
+
let input : Procedure inputCode QuantumRawExchange.scheduleCode rawInput :=
|
| 55 |
+
outputCountProgram.pair
|
| 56 |
+
((Procedure.unaryToBits.comp precisionProgram).pair rawEntriesProgram)
|
| 57 |
+
exact QuantumRawExchange.compileProgram.comp input
|
| 58 |
+
|
| 59 |
+
noncomputable def certificate : Turing.TM2ComputableInPolyTime inputCode
|
| 60 |
+
(prodCode (listCode MediatorListProgram.bondCode) ratCode) output := outputProgram.toTM2
|
| 61 |
+
|
| 62 |
+
variable {ι κ : Type} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ]
|
| 63 |
+
variable {m n : ℕ}
|
| 64 |
+
|
| 65 |
+
def finalSites (xs : κ → List ι) (w : κ → ι → Fin 4) :=
|
| 66 |
+
QuantumOrderedPrivate.outputSites (QuantumOrderedXZ.sites xs w)
|
| 67 |
+
|
| 68 |
+
def finalWord (xs : κ → List ι) (w : κ → ι → Fin 4) :=
|
| 69 |
+
QuantumOrderedPrivate.outputWord (QuantumOrderedXZ.sites xs w) (QuantumOrderedXZ.word xs w)
|
| 70 |
+
|
| 71 |
+
def finalCoefficient (J : κ → ℚ) (N : ℕ) :=
|
| 72 |
+
QuantumOrderedPrivate.outputCoefficient (QuantumOrderedXZ.coefficient J N) N
|
| 73 |
+
|
| 74 |
+
theorem output_table (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 75 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ)
|
| 76 |
+
(hlen : ∀ a, (xs a).length ≤ 6) (hx : ∀ a, (xs a).Nodup) (N : ℕ) :
|
| 77 |
+
output (N,n,table e (index q) xs w J) =
|
| 78 |
+
QuantumOrderedRawBlock.output N
|
| 79 |
+
(numberedSites (qubits6 q e) (terms6 e) (finalSites xs w))
|
| 80 |
+
(numberedWord (qubits6 q e) (terms6 e) (finalWord xs w))
|
| 81 |
+
(fun i => finalCoefficient J N (terms6 e i)) := by
|
| 82 |
+
unfold output rawInput outputCount rawEntries labelEntries classify
|
| 83 |
+
simp only [Function.comp_apply]
|
| 84 |
+
simp only [QuantumOrderedLabelTable.output_table q e xs w J hlen hx N]
|
| 85 |
+
rw [packed_table]
|
| 86 |
+
rfl
|
| 87 |
+
|
| 88 |
+
omit [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] in
|
| 89 |
+
theorem qubitCount_table (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 90 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ) (N : ℕ) :
|
| 91 |
+
qubitCount (N,n,table e (index q) xs w J)=4*(n+3717*m) := by
|
| 92 |
+
rw [qubitCount,QuantumOrderedLabelPipeline.output_qubits]
|
| 93 |
+
simp only [table,List.length_ofFn]
|
| 94 |
+
|
| 95 |
+
end ContinuumCoulomb.QuantumOrderedLabelCompile
|
| 96 |
+
|
| 97 |
+
end
|
| 98 |
+
|
| 99 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelCorrectness.lean
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelTable
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelPipeline
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Each literal list stage is exactly the corresponding ordered Pauli
|
| 7 |
+
construction, with explicit finite product and sum enumerations. -/
|
| 8 |
+
|
| 9 |
+
noncomputable section
|
| 10 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelTable
|
| 11 |
+
open QuantumOrderedLabelData QuantumOrderedLabelFamily
|
| 12 |
+
open scoped Classical
|
| 13 |
+
|
| 14 |
+
variable {ι κ : Type} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ]
|
| 15 |
+
variable {m n d : ℕ}
|
| 16 |
+
|
| 17 |
+
omit [Fintype ι] [DecidableEq ι] [DecidableEq κ] in
|
| 18 |
+
theorem value_table (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 19 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ) (N : ℕ)
|
| 20 |
+
(f : ℕ → List Letter → Fin d → List Letter)
|
| 21 |
+
(g : ℚ → ℚ → Fin d → ℚ)
|
| 22 |
+
(ys : κ × Fin d → List (ι ⊕ κ)) (v : κ × Fin d → ι ⊕ κ → Fin 4)
|
| 23 |
+
(h : ∀ p, tag (Sum.elim (index q) (fun a => n+(e.symm a).val)) (ys p) (v p) =
|
| 24 |
+
f (n+(e.symm p.1).val) (tag (index q) (xs p.1) (w p.1)) p.2) :
|
| 25 |
+
value d f g (N,n,table e (index q) xs w J) =
|
| 26 |
+
(n+m,table (nextTerm e d) (index (nextQubit q e)) ys v
|
| 27 |
+
(fun p => g (QuantumOrderedSubdivision.scale J N) (J p.1) p.2)) := by
|
| 28 |
+
apply Prod.ext
|
| 29 |
+
· simp only [value,table,List.length_ofFn]
|
| 30 |
+
· rw [show (value d f g (N,n,table e (index q) xs w J)).2 =
|
| 31 |
+
family d f g (N,n,table e (index q) xs w J) from rfl,
|
| 32 |
+
family_table]
|
| 33 |
+
unfold table
|
| 34 |
+
apply congrArg List.ofFn
|
| 35 |
+
funext i
|
| 36 |
+
dsimp only
|
| 37 |
+
rw [nextQubit_index,h]
|
| 38 |
+
|
| 39 |
+
theorem subdivision_table (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 40 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ)
|
| 41 |
+
(hx : ∀ a, (xs a).Nodup) (N cut : ℕ) :
|
| 42 |
+
QuantumOrderedLabelPipeline.subdivisionStep cut (N,n,table e (index q) xs w J) =
|
| 43 |
+
(N,n+m,table (nextTerm e 4) (index (nextQubit q e))
|
| 44 |
+
(QuantumOrderedSubdivision.outputSites xs cut)
|
| 45 |
+
(QuantumOrderedSubdivision.outputWord xs cut w)
|
| 46 |
+
(QuantumOrderedSubdivision.outputCoefficient J N)) := by
|
| 47 |
+
apply congrArg (Prod.mk N)
|
| 48 |
+
exact value_table q e xs w J N _ _ _ _
|
| 49 |
+
(subdivision_tag (index q) (fun a => n+(e.symm a).val) xs w hx cut)
|
| 50 |
+
|
| 51 |
+
theorem third_table (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 52 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ)
|
| 53 |
+
(hlen : ∀ a, (xs a).length ≤ 3) (hx : ∀ a, (xs a).Nodup) (N : ℕ) :
|
| 54 |
+
QuantumOrderedLabelPipeline.thirdStep (N,n,table e (index q) xs w J) =
|
| 55 |
+
(N,n+m,table (nextTerm e 7) (index (nextQubit q e))
|
| 56 |
+
(QuantumOrderedThird.outputSites xs w) (QuantumOrderedThird.outputWord xs w)
|
| 57 |
+
(QuantumOrderedThird.outputCoefficient J N)) := by
|
| 58 |
+
apply congrArg (Prod.mk N)
|
| 59 |
+
exact value_table q e xs w J N _ _ _ _
|
| 60 |
+
(thirdBlock_tag (index q) (fun a => n+(e.symm a).val) xs w hlen hx)
|
| 61 |
+
|
| 62 |
+
omit [Fintype ι] in
|
| 63 |
+
theorem yy_table (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 64 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ)
|
| 65 |
+
(hx : ∀ a, (xs a).Nodup) (N : ℕ) :
|
| 66 |
+
QuantumOrderedLabelPipeline.yyStep (N,n,table e (index q) xs w J) =
|
| 67 |
+
(N,n+m,table (nextTerm e 4) (index (nextQubit q e))
|
| 68 |
+
(QuantumOrderedYY.outputSites xs) (QuantumOrderedYY.outputWord xs w)
|
| 69 |
+
(QuantumOrderedYY.outputCoefficient J N)) := by
|
| 70 |
+
apply congrArg (Prod.mk N)
|
| 71 |
+
exact value_table q e xs w J N _ _ _ _
|
| 72 |
+
(yyBlock_tag (index q) (fun a => n+(e.symm a).val) xs w hx)
|
| 73 |
+
|
| 74 |
+
omit [Fintype ι] in
|
| 75 |
+
theorem private_table (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 76 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ) (N : ℕ) :
|
| 77 |
+
QuantumOrderedLabelPipeline.privateStep (N,n,table e (index q) xs w J) =
|
| 78 |
+
(N,n+m,table (nextTerm e 4) (index (nextQubit q e))
|
| 79 |
+
(QuantumOrderedPrivate.outputSites xs) (QuantumOrderedPrivate.outputWord xs w)
|
| 80 |
+
(QuantumOrderedPrivate.outputCoefficient J N)) := by
|
| 81 |
+
apply congrArg (Prod.mk N)
|
| 82 |
+
exact value_table q e xs w J N _ _ _ _
|
| 83 |
+
(privateBlock_tag (index q) (fun a => n+(e.symm a).val) xs w)
|
| 84 |
+
|
| 85 |
+
end ContinuumCoulomb.QuantumOrderedLabelTable
|
| 86 |
+
|
| 87 |
+
end
|
| 88 |
+
|
| 89 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelData.lean
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedRawPacking
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedThirdSites
|
| 3 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedYYReduction
|
| 4 |
+
|
| 5 |
+
namespace OAI
|
| 6 |
+
|
| 7 |
+
/-! Ordered sparse site/letter arrays. Every word carries the already
|
| 8 |
+
proved support list; the bounded gadget operations inspect at most six
|
| 9 |
+
letters, and retain the original order even for identity letters. -/
|
| 10 |
+
|
| 11 |
+
noncomputable section
|
| 12 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelData
|
| 13 |
+
open scoped BigOperators Classical
|
| 14 |
+
|
| 15 |
+
abbrev Letter := QuantumOrderedRawPacking.Letter
|
| 16 |
+
|
| 17 |
+
def tag {ι : Type} (index : ι → ℕ) (xs : List ι) (w : ι → Fin 4) : List Letter :=
|
| 18 |
+
xs.map (fun i => (index i,(w i).val))
|
| 19 |
+
|
| 20 |
+
def partition (xs : List Letter) : List Letter × List Letter :=
|
| 21 |
+
match xs with
|
| 22 |
+
| [a,b,c] => if a.2=2 then
|
| 23 |
+
if b.2=2 then ([a,b],[c]) else ([a,c],[b])
|
| 24 |
+
else ([b,c],[a])
|
| 25 |
+
| _ => (xs,[])
|
| 26 |
+
|
| 27 |
+
def yCount (xs : List Letter) : ℕ := (xs.filter (fun a => a.2=2)).length
|
| 28 |
+
|
| 29 |
+
def axis (xs : List Letter) : ℕ := if Odd (yCount xs) then 2 else 1
|
| 30 |
+
|
| 31 |
+
theorem tag_length {ι : Type} (index : ι → ℕ) (xs : List ι) (w : ι → Fin 4) :
|
| 32 |
+
(tag index xs w).length=xs.length := List.length_map _
|
| 33 |
+
|
| 34 |
+
theorem tag_take {ι : Type} (index : ι → ℕ) (xs : List ι) (w : ι → Fin 4) (d : ℕ) :
|
| 35 |
+
tag index (xs.take d) w = (tag index xs w).take d := by
|
| 36 |
+
simp only [tag,List.map_take]
|
| 37 |
+
|
| 38 |
+
theorem tag_drop {ι : Type} (index : ι → ℕ) (xs : List ι) (w : ι → Fin 4) (d : ℕ) :
|
| 39 |
+
tag index (xs.drop d) w = (tag index xs w).drop d := by
|
| 40 |
+
simp only [tag,List.map_drop]
|
| 41 |
+
|
| 42 |
+
theorem partition_tag {ι : Type} (index : ι → ℕ) (xs : List ι) (w : ι → Fin 4) :
|
| 43 |
+
partition (tag index xs w) =
|
| 44 |
+
(tag index (QuantumOrderedTriple.partition xs w).1 w,
|
| 45 |
+
tag index (QuantumOrderedTriple.partition xs w).2 w) := by
|
| 46 |
+
cases xs with
|
| 47 |
+
| nil => rfl
|
| 48 |
+
| cons a xs =>
|
| 49 |
+
cases xs with
|
| 50 |
+
| nil => rfl
|
| 51 |
+
| cons b xs =>
|
| 52 |
+
cases xs with
|
| 53 |
+
| nil => rfl
|
| 54 |
+
| cons c xs =>
|
| 55 |
+
cases xs with
|
| 56 |
+
| cons d xs => rfl
|
| 57 |
+
| nil =>
|
| 58 |
+
have ha : (w a).val=2 ↔ w a=2 := by
|
| 59 |
+
constructor
|
| 60 |
+
· intro h; exact Fin.ext h
|
| 61 |
+
· intro h; exact congrArg Fin.val h
|
| 62 |
+
have hb : (w b).val=2 ↔ w b=2 := by
|
| 63 |
+
constructor
|
| 64 |
+
· intro h; exact Fin.ext h
|
| 65 |
+
· intro h; exact congrArg Fin.val h
|
| 66 |
+
simp only [tag,List.map_cons,List.map_nil,partition,ha,hb,
|
| 67 |
+
QuantumOrderedTriple.partition]
|
| 68 |
+
split_ifs <;> rfl
|
| 69 |
+
|
| 70 |
+
variable {ι : Type} [Fintype ι] [DecidableEq ι]
|
| 71 |
+
|
| 72 |
+
theorem yCount_tag (index : ι → ℕ) (xs : List ι) (w : ι → Fin 4)
|
| 73 |
+
(hx : xs.Nodup) (hw : qmaPauliSupport w ⊆ xs.toFinset) :
|
| 74 |
+
yCount (tag index xs w)=qmaPauliYCount w := by
|
| 75 |
+
have hfilter : (xs.filter (fun i => w i=2)).toFinset =
|
| 76 |
+
Finset.univ.filter (fun i => w i=2) := by
|
| 77 |
+
ext i
|
| 78 |
+
simp only [List.mem_toFinset,List.mem_filter,Finset.mem_filter,
|
| 79 |
+
Finset.mem_univ,true_and,decide_eq_true_eq]
|
| 80 |
+
constructor
|
| 81 |
+
· exact fun h => h.2
|
| 82 |
+
· intro h
|
| 83 |
+
exact ⟨List.mem_toFinset.mp (hw (by simp [qmaPauliSupport,h])),h⟩
|
| 84 |
+
have hcount := List.toFinset_card_of_nodup (hx.filter (fun i => w i=2))
|
| 85 |
+
rw [hfilter] at hcount
|
| 86 |
+
unfold yCount tag
|
| 87 |
+
rw [List.filter_map]
|
| 88 |
+
have hv : (fun i : ι => decide ((w i).val=2)) = (fun i => decide (w i=2)) := by
|
| 89 |
+
funext i
|
| 90 |
+
congr 1
|
| 91 |
+
exact propext ⟨fun h => Fin.ext h,fun h => congrArg Fin.val h⟩
|
| 92 |
+
simp only [Function.comp_def,hv,List.length_map]
|
| 93 |
+
exact hcount.symm
|
| 94 |
+
|
| 95 |
+
omit [Fintype ι] in
|
| 96 |
+
theorem tag_restrict (index : ι → ℕ) (xs : List ι) (w : ι → Fin 4)
|
| 97 |
+
(ys : List ι) (hys : ∀ i ∈ xs, i ∈ ys) :
|
| 98 |
+
tag index xs (qmaPauliRestrict ys.toFinset w)=tag index xs w := by
|
| 99 |
+
apply List.map_congr_left
|
| 100 |
+
intro i hi
|
| 101 |
+
simp only [qmaPauliRestrict,List.mem_toFinset.mpr (hys i hi),ite_true]
|
| 102 |
+
|
| 103 |
+
end ContinuumCoulomb.QuantumOrderedLabelData
|
| 104 |
+
|
| 105 |
+
end
|
| 106 |
+
|
| 107 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelEnergy.lean
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelCompile
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedXZEnergy
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Full-space energy guarantee for the emitted raw exchange list, with
|
| 7 |
+
the five early reductions, private-pair subdivision, and four-spin error
|
| 8 |
+
all accounted for. -/
|
| 9 |
+
|
| 10 |
+
noncomputable section
|
| 11 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelCompile
|
| 12 |
+
open QuantumOrderedLabelTable
|
| 13 |
+
open scoped Classical
|
| 14 |
+
|
| 15 |
+
def outputEnergy (x : Input) : ℝ :=
|
| 16 |
+
MediatorGraph.normalizedBottom (QuantumRawExchange.rawMatrix (qubitCount x) (output x))
|
| 17 |
+
|
| 18 |
+
variable {ι κ : Type} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ]
|
| 19 |
+
variable {m n : ℕ}
|
| 20 |
+
|
| 21 |
+
def finalEnergy (xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ) (N : ℕ) : ℝ :=
|
| 22 |
+
MediatorGraph.normalizedBottom (qmaPauliFamily (finalWord xs w)
|
| 23 |
+
(fun p => (finalCoefficient J N p:ℝ)))
|
| 24 |
+
|
| 25 |
+
theorem compiled_final_error (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 26 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ)
|
| 27 |
+
(hlen : ∀ a, (xs a).length ≤ 6) (hx : ∀ a, (xs a).Nodup)
|
| 28 |
+
(hcover : ∀ a, qmaPauliSupport (w a) ⊆ (xs a).toFinset)
|
| 29 |
+
(he : ∀ a, Even (qmaPauliYCount (w a))) (N : ℕ) (hN : 0 < N) :
|
| 30 |
+
|outputEnergy (N,n,table e (index q) xs w J)-finalEnergy xs w J N| ≤ 2/(N:ℝ) := by
|
| 31 |
+
let qf := qubits6 q e
|
| 32 |
+
let ef := terms6 e
|
| 33 |
+
have hlenF : ∀ p, (finalSites xs w p).length ≤ 2 :=
|
| 34 |
+
QuantumOrderedPrivate.outputSites_length _ (QuantumOrderedXZ.sites_length xs w hlen)
|
| 35 |
+
have hxF : ∀ p, (finalSites xs w p).Nodup :=
|
| 36 |
+
QuantumOrderedPrivate.outputSites_nodup _ (QuantumOrderedXZ.sites_nodup xs w hlen hx)
|
| 37 |
+
have hsF : ∀ p, qmaPauliSupport (finalWord xs w p) ⊆ (finalSites xs w p).toFinset :=
|
| 38 |
+
QuantumOrderedPrivate.outputSites_cover _ _
|
| 39 |
+
have hyF : ∀ p i, finalWord xs w p i ≠ 2 :=
|
| 40 |
+
QuantumOrderedPrivate.output_noY _ _ (QuantumOrderedXZ.noY xs w hlen hx hcover he)
|
| 41 |
+
have hpF : ∀ p r, (qmaPauliSupport (finalWord xs w p)).card=2 →
|
| 42 |
+
qmaPauliSupport (finalWord xs w p)=qmaPauliSupport (finalWord xs w r) → p=r :=
|
| 43 |
+
QuantumOrderedPrivate.output_private _ _ (QuantumOrderedXZ.sites_nodup xs w hlen hx)
|
| 44 |
+
have hr := QuantumOrderedRawBlock.output_accuracy N hN
|
| 45 |
+
(numberedSites qf ef (finalSites xs w)) (numberedWord qf ef (finalWord xs w))
|
| 46 |
+
(fun i => finalCoefficient J N (ef i))
|
| 47 |
+
(fun i => (numbered_sites_length qf ef _ i).trans_le (hlenF (ef i)))
|
| 48 |
+
(numbered_sites_nodup qf ef _ hxF) (numbered_cover qf ef _ _ hsF)
|
| 49 |
+
(fun i j => hyF (ef i) (qf j)) (numbered_private qf ef _ hpF)
|
| 50 |
+
have hn : qubitCount (N,n,table e (index q) xs w J)=finalCount n m*4 := by
|
| 51 |
+
rw [qubitCount_table,finalCount_eq]
|
| 52 |
+
omega
|
| 53 |
+
unfold outputEnergy
|
| 54 |
+
rw [hn,output_table q e xs w J hlen hx N]
|
| 55 |
+
unfold finalEnergy
|
| 56 |
+
rw [← numbered_energy qf ef (finalWord xs w) (fun p => (finalCoefficient J N p:ℝ))]
|
| 57 |
+
exact hr
|
| 58 |
+
|
| 59 |
+
theorem final_xz_error (xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ)
|
| 60 |
+
(hlen : ∀ a, (xs a).length ≤ 6) (hx : ∀ a, (xs a).Nodup)
|
| 61 |
+
(N : ℕ) (hN : 0 < N) :
|
| 62 |
+
|finalEnergy xs w J N-QuantumOrderedXZ.energy xs w J N| ≤ 1/(N:ℝ) :=
|
| 63 |
+
QuantumOrderedPrivate.output_accuracy _ _ _ (QuantumOrderedXZ.sites_nodup xs w hlen hx)
|
| 64 |
+
(QuantumOrderedXZ.sites_cover xs w) N (by omega)
|
| 65 |
+
|
| 66 |
+
theorem output_accuracy (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 67 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ)
|
| 68 |
+
(hlen : ∀ a, (xs a).length ≤ 6) (hx : ∀ a, (xs a).Nodup)
|
| 69 |
+
(hcover : ∀ a, qmaPauliSupport (w a) ⊆ (xs a).toFinset)
|
| 70 |
+
(he : ∀ a, Even (qmaPauliYCount (w a))) (N : ℕ) (hN : 0 < N) :
|
| 71 |
+
|outputEnergy (N,n,table e (index q) xs w J)-
|
| 72 |
+
MediatorGraph.normalizedBottom (qmaPauliFamily w (fun a => (J a:ℝ)))| ≤ 8/(N:ℝ) := by
|
| 73 |
+
have h₁ := compiled_final_error q e xs w J hlen hx hcover he N hN
|
| 74 |
+
have h₂ := final_xz_error xs w J hlen hx N hN
|
| 75 |
+
have h₃ := QuantumOrderedXZ.accuracy xs w J hlen hx hcover he N (by omega)
|
| 76 |
+
exact (abs_sub_le _ (finalEnergy xs w J N) _).trans
|
| 77 |
+
((add_le_add h₁ ((abs_sub_le _ (QuantumOrderedXZ.energy xs w J N) _).trans
|
| 78 |
+
(add_le_add h₂ h₃))).trans_eq (by ring))
|
| 79 |
+
|
| 80 |
+
end ContinuumCoulomb.QuantumOrderedLabelCompile
|
| 81 |
+
|
| 82 |
+
end
|
| 83 |
+
|
| 84 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelFamily.lean
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelProgram
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedWeightProgram
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! A literal indexed list stage, shared by the six fixed local reductions.
|
| 7 |
+
New mediator indices are the old qubit count plus the input term index.
|
| 8 |
+
Unary counts bound the output size; rational coefficients stay binary. -/
|
| 9 |
+
|
| 10 |
+
noncomputable section
|
| 11 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelFamily
|
| 12 |
+
open ExactQuantumFactoring.BitStackProgram
|
| 13 |
+
open QuantumOrderedLabelData
|
| 14 |
+
|
| 15 |
+
abbrev Entry := List Letter × ℚ
|
| 16 |
+
abbrev State := ℕ × List Entry
|
| 17 |
+
abbrev Input := ℕ × State
|
| 18 |
+
abbrev BlockInput := (ℕ × ℚ) × Entry
|
| 19 |
+
|
| 20 |
+
def entryCode : Entry → List Bool := prodCode labelsCode ratCode
|
| 21 |
+
def stateCode : State → List Bool := prodCode unaryCode (listCode entryCode)
|
| 22 |
+
def inputCode : Input → List Bool := prodCode unaryCode stateCode
|
| 23 |
+
def blockCode : BlockInput → List Bool := prodCode (prodCode Nat.bits ratCode) entryCode
|
| 24 |
+
|
| 25 |
+
def weights (x : Input) : QuantumOrderedWeightProgram.Input := (x.1,x.2.2.map Prod.snd)
|
| 26 |
+
def radius (x : Input) : ℚ := QuantumOrderedWeightProgram.scale (weights x)
|
| 27 |
+
def indexed (x : ℕ × Input) : BlockInput :=
|
| 28 |
+
((x.2.2.1+x.1,radius x.2),(x.2.2.2.drop x.1).headD ([],0))
|
| 29 |
+
|
| 30 |
+
def block (d : ℕ) (f : ℕ → List Letter → Fin d → List Letter)
|
| 31 |
+
(g : ℚ → ℚ → Fin d → ℚ) (x : BlockInput) : List Entry :=
|
| 32 |
+
List.ofFn (fun k => (f x.1.1 x.2.1 k,g x.1.2 x.2.2 k))
|
| 33 |
+
|
| 34 |
+
def family (d : ℕ) (f : ℕ → List Letter → Fin d → List Letter)
|
| 35 |
+
(g : ℚ → ℚ → Fin d → ℚ) (x : Input) : List Entry :=
|
| 36 |
+
((List.range x.2.2.length).map (fun i => block d f g (indexed (i,x)))).flatten
|
| 37 |
+
|
| 38 |
+
def value (d : ℕ) (f : ℕ → List Letter → Fin d → List Letter)
|
| 39 |
+
(g : ℚ → ℚ → Fin d → ℚ) (x : Input) : State :=
|
| 40 |
+
(x.2.1+x.2.2.length,family d f g x)
|
| 41 |
+
|
| 42 |
+
noncomputable opaque stateProgram : Procedure inputCode stateCode Prod.snd := Procedure.second _ _
|
| 43 |
+
noncomputable opaque precisionProgram : Procedure inputCode unaryCode Prod.fst := Procedure.first _ _
|
| 44 |
+
noncomputable opaque countProgram : Procedure inputCode unaryCode (fun x => x.2.1) :=
|
| 45 |
+
(Procedure.first _ _).comp stateProgram
|
| 46 |
+
noncomputable opaque entriesProgram : Procedure inputCode (listCode entryCode) (fun x => x.2.2) :=
|
| 47 |
+
(Procedure.second _ _).comp stateProgram
|
| 48 |
+
noncomputable opaque lengthProgram : Procedure inputCode unaryCode (fun x => x.2.2.length) :=
|
| 49 |
+
(ExactQuantumFactoring.NativeAIG.Emission.listUnaryLength entryCode ([],0)).comp entriesProgram
|
| 50 |
+
noncomputable opaque weightsProgram : Procedure inputCode QuantumOrderedWeightProgram.inputCode weights :=
|
| 51 |
+
precisionProgram.pair ((Procedure.listMap ([],0) 0
|
| 52 |
+
(Procedure.second labelsCode ratCode)).comp entriesProgram)
|
| 53 |
+
noncomputable opaque radiusProgram : Procedure inputCode ratCode radius :=
|
| 54 |
+
QuantumOrderedWeightProgram.scaleProgram.comp weightsProgram
|
| 55 |
+
|
| 56 |
+
noncomputable opaque indexedProgram : Procedure (prodCode unaryCode inputCode) blockCode indexed := by
|
| 57 |
+
let i := Procedure.first unaryCode inputCode
|
| 58 |
+
let x := Procedure.second unaryCode inputCode
|
| 59 |
+
let n := (Procedure.unaryToBits.comp countProgram).comp x
|
| 60 |
+
let j := Procedure.unaryToBits.comp i
|
| 61 |
+
let selected := (Procedure.listGet entryCode ([],0)).comp (j.pair (entriesProgram.comp x))
|
| 62 |
+
exact ((Procedure.binaryAdd.comp (n.pair j)).pair (radiusProgram.comp x)).pair selected
|
| 63 |
+
|
| 64 |
+
noncomputable def blockProgram (d : ℕ)
|
| 65 |
+
(f : ℕ → List Letter → Fin d → List Letter) (g : ℚ → ℚ → Fin d → ℚ)
|
| 66 |
+
(pf : ∀ k, Procedure QuantumOrderedLabelData.blockCode labelsCode (fun x => f x.1 x.2 k))
|
| 67 |
+
(pg : ∀ k, Procedure QuantumOrderedWeightProgram.pairCode ratCode (fun x => g x.1 x.2 k)) :
|
| 68 |
+
Procedure blockCode (listCode entryCode) (block d f g) := by
|
| 69 |
+
let params := Procedure.first (prodCode Nat.bits ratCode) entryCode
|
| 70 |
+
let entry := Procedure.second (prodCode Nat.bits ratCode) entryCode
|
| 71 |
+
let mediator := (Procedure.first Nat.bits ratCode).comp params
|
| 72 |
+
let scale := (Procedure.second Nat.bits ratCode).comp params
|
| 73 |
+
let labels := (Procedure.first labelsCode ratCode).comp entry
|
| 74 |
+
let coefficient := (Procedure.second labelsCode ratCode).comp entry
|
| 75 |
+
exact QuantumRawExchange.fixedListProgram blockCode entryCode d _
|
| 76 |
+
(fun k => ((pf k).comp (mediator.pair labels)).pair
|
| 77 |
+
((pg k).comp (scale.pair coefficient)))
|
| 78 |
+
|
| 79 |
+
noncomputable def familyProgram (d : ℕ)
|
| 80 |
+
(f : ℕ → List Letter → Fin d → List Letter) (g : ℚ → ℚ → Fin d → ℚ)
|
| 81 |
+
(p : Procedure blockCode (listCode entryCode) (block d f g)) :
|
| 82 |
+
Procedure inputCode (listCode entryCode) (family d f g) := by
|
| 83 |
+
let tab := Procedure.tabulate (f := fun x i => block d f g (indexed (i,x))) []
|
| 84 |
+
(p.comp indexedProgram)
|
| 85 |
+
exact (QuantumRawExchange.flattenProgram entryCode ([],0)).comp
|
| 86 |
+
(tab.comp (lengthProgram.pair (Procedure.identity inputCode)))
|
| 87 |
+
|
| 88 |
+
noncomputable def valueProgram (d : ℕ)
|
| 89 |
+
(f : ℕ → List Letter → Fin d → List Letter) (g : ℚ → ℚ → Fin d → ℚ)
|
| 90 |
+
(p : Procedure blockCode (listCode entryCode) (block d f g)) :
|
| 91 |
+
Procedure inputCode stateCode (value d f g) :=
|
| 92 |
+
(Procedure.unaryAdd.comp (countProgram.pair lengthProgram)).pair (familyProgram d f g p)
|
| 93 |
+
|
| 94 |
+
theorem family_length (d : ℕ)
|
| 95 |
+
(f : ℕ → List Letter → Fin d → List Letter) (g : ℚ → ℚ → Fin d → ℚ)
|
| 96 |
+
(x : Input) : (family d f g x).length=x.2.2.length*d := by
|
| 97 |
+
unfold family
|
| 98 |
+
rw [List.length_flatten,List.map_map]
|
| 99 |
+
simp only [Function.comp_def,block,List.length_ofFn]
|
| 100 |
+
simp
|
| 101 |
+
|
| 102 |
+
end ContinuumCoulomb.QuantumOrderedLabelFamily
|
| 103 |
+
|
| 104 |
+
end
|
| 105 |
+
|
| 106 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelOutput.lean
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelCorrectness
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! The complete literal sparse-label compiler equals the actual ordered
|
| 6 |
+
six-to-four-to-three-to-two-to-XZ construction and private-pair stage. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelTable
|
| 10 |
+
open scoped Classical
|
| 11 |
+
|
| 12 |
+
variable {ι κ : Type} {m n : ℕ}
|
| 13 |
+
|
| 14 |
+
def terms1 (e : Fin m ≃ κ) := nextTerm e 4
|
| 15 |
+
def terms2 (e : Fin m ≃ κ) := nextTerm (terms1 e) 4
|
| 16 |
+
def terms3 (e : Fin m ≃ κ) := nextTerm (terms2 e) 7
|
| 17 |
+
def terms4 (e : Fin m ≃ κ) := nextTerm (terms3 e) 4
|
| 18 |
+
def terms5 (e : Fin m ≃ κ) := nextTerm (terms4 e) 7
|
| 19 |
+
def terms6 (e : Fin m ≃ κ) := nextTerm (terms5 e) 4
|
| 20 |
+
|
| 21 |
+
def qubits1 (q : Fin n ≃ ι) (e : Fin m ≃ κ) := nextQubit q e
|
| 22 |
+
def qubits2 (q : Fin n ≃ ι) (e : Fin m ≃ κ) := nextQubit (qubits1 q e) (terms1 e)
|
| 23 |
+
def qubits3 (q : Fin n ≃ ι) (e : Fin m ≃ κ) := nextQubit (qubits2 q e) (terms2 e)
|
| 24 |
+
def qubits4 (q : Fin n ≃ ι) (e : Fin m ≃ κ) := nextQubit (qubits3 q e) (terms3 e)
|
| 25 |
+
def qubits5 (q : Fin n ≃ ι) (e : Fin m ≃ κ) := nextQubit (qubits4 q e) (terms4 e)
|
| 26 |
+
def qubits6 (q : Fin n ≃ ι) (e : Fin m ≃ κ) := nextQubit (qubits5 q e) (terms5 e)
|
| 27 |
+
|
| 28 |
+
def finalCount (n m : ℕ) : ℕ :=
|
| 29 |
+
n+m+m*4+m*4*4+m*4*4*7+m*4*4*7*4+m*4*4*7*4*7
|
| 30 |
+
|
| 31 |
+
theorem finalCount_eq (n m : ℕ) : finalCount n m=n+3717*m := by
|
| 32 |
+
unfold finalCount
|
| 33 |
+
omega
|
| 34 |
+
|
| 35 |
+
variable [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ]
|
| 36 |
+
|
| 37 |
+
theorem output_table (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 38 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ)
|
| 39 |
+
(hlen : ∀ a, (xs a).length ≤ 6) (hx : ∀ a, (xs a).Nodup) (N : ℕ) :
|
| 40 |
+
QuantumOrderedLabelPipeline.output (N,n,table e (index q) xs w J) =
|
| 41 |
+
(finalCount n m,table (terms6 e) (index (qubits6 q e))
|
| 42 |
+
(QuantumOrderedPrivate.outputSites (QuantumOrderedXZ.sites xs w))
|
| 43 |
+
(QuantumOrderedPrivate.outputWord (QuantumOrderedXZ.sites xs w)
|
| 44 |
+
(QuantumOrderedXZ.word xs w))
|
| 45 |
+
(QuantumOrderedPrivate.outputCoefficient (QuantumOrderedXZ.coefficient J N) N)) := by
|
| 46 |
+
have h1 := subdivision_table q e xs w J hx N 3
|
| 47 |
+
have h2 := subdivision_table (qubits1 q e) (terms1 e)
|
| 48 |
+
(QuantumOrderedSubdivision.outputSites xs 3)
|
| 49 |
+
(QuantumOrderedSubdivision.outputWord xs 3 w)
|
| 50 |
+
(QuantumOrderedSubdivision.outputCoefficient J N)
|
| 51 |
+
(QuantumOrderedSubdivision.outputSites_nodup xs 3 hx) N 2
|
| 52 |
+
have h3 := third_table (qubits2 q e) (terms2 e)
|
| 53 |
+
(QuantumOrderedXZ.threeSites xs) (QuantumOrderedXZ.threeWord xs w)
|
| 54 |
+
(QuantumOrderedXZ.threeCoefficient J N)
|
| 55 |
+
(QuantumOrderedXZ.threeSites_length xs hlen) (QuantumOrderedXZ.threeSites_nodup xs hx) N
|
| 56 |
+
have h4 := yy_table (qubits3 q e) (terms3 e)
|
| 57 |
+
(QuantumOrderedXZ.twoSites xs w) (QuantumOrderedXZ.twoWord xs w)
|
| 58 |
+
(QuantumOrderedXZ.twoCoefficient J N)
|
| 59 |
+
(QuantumOrderedXZ.twoSites_nodup xs w hlen hx) N
|
| 60 |
+
have h5 := third_table (qubits4 q e) (terms4 e)
|
| 61 |
+
(QuantumOrderedXZ.xzThreeSites xs w) (QuantumOrderedXZ.xzThreeWord xs w)
|
| 62 |
+
(QuantumOrderedXZ.xzThreeCoefficient J N)
|
| 63 |
+
(QuantumOrderedXZ.xzThreeSites_length xs w hlen)
|
| 64 |
+
(QuantumOrderedXZ.xzThreeSites_nodup xs w hlen hx) N
|
| 65 |
+
have h6 := private_table (qubits5 q e) (terms5 e)
|
| 66 |
+
(QuantumOrderedXZ.sites xs w) (QuantumOrderedXZ.word xs w)
|
| 67 |
+
(QuantumOrderedXZ.coefficient J N) N
|
| 68 |
+
change _ = (N,n+m,table (terms1 e) (index (qubits1 q e))
|
| 69 |
+
(QuantumOrderedSubdivision.outputSites xs 3)
|
| 70 |
+
(QuantumOrderedSubdivision.outputWord xs 3 w)
|
| 71 |
+
(QuantumOrderedSubdivision.outputCoefficient J N)) at h1
|
| 72 |
+
change _ = (N,n+m+m*4,table (terms2 e) (index (qubits2 q e))
|
| 73 |
+
(QuantumOrderedXZ.threeSites xs) (QuantumOrderedXZ.threeWord xs w)
|
| 74 |
+
(QuantumOrderedXZ.threeCoefficient J N)) at h2
|
| 75 |
+
change _ = (N,n+m+m*4+m*4*4,table (terms3 e) (index (qubits3 q e))
|
| 76 |
+
(QuantumOrderedXZ.twoSites xs w) (QuantumOrderedXZ.twoWord xs w)
|
| 77 |
+
(QuantumOrderedXZ.twoCoefficient J N)) at h3
|
| 78 |
+
change _ = (N,n+m+m*4+m*4*4+m*4*4*7,table (terms4 e) (index (qubits4 q e))
|
| 79 |
+
(QuantumOrderedXZ.xzThreeSites xs w) (QuantumOrderedXZ.xzThreeWord xs w)
|
| 80 |
+
(QuantumOrderedXZ.xzThreeCoefficient J N)) at h4
|
| 81 |
+
change _ = (N,n+m+m*4+m*4*4+m*4*4*7+m*4*4*7*4,
|
| 82 |
+
table (terms5 e) (index (qubits5 q e))
|
| 83 |
+
(QuantumOrderedXZ.sites xs w) (QuantumOrderedXZ.word xs w)
|
| 84 |
+
(QuantumOrderedXZ.coefficient J N)) at h5
|
| 85 |
+
unfold QuantumOrderedLabelPipeline.output
|
| 86 |
+
rw [h1,h2,h3,h4,h5,h6]
|
| 87 |
+
rfl
|
| 88 |
+
|
| 89 |
+
end ContinuumCoulomb.QuantumOrderedLabelTable
|
| 90 |
+
|
| 91 |
+
end
|
| 92 |
+
|
| 93 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelPacking.lean
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelOutput
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedRawBlock
|
| 3 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumSpatialReindex
|
| 4 |
+
|
| 5 |
+
namespace OAI
|
| 6 |
+
|
| 7 |
+
/-! Conversion of the actual ordered sparse labels into the literal raw
|
| 8 |
+
X/Z instructions, including the explicit finite relabeling of their energy. -/
|
| 9 |
+
|
| 10 |
+
noncomputable section
|
| 11 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelTable
|
| 12 |
+
open scoped BigOperators Classical
|
| 13 |
+
|
| 14 |
+
variable {ι κ : Type} {n m : ℕ}
|
| 15 |
+
|
| 16 |
+
def numberedSites (q : Fin n ≃ ι) (e : Fin m ≃ κ) (xs : κ → List ι) :
|
| 17 |
+
Fin m → List (Fin n) := fun a => (xs (e a)).map q.symm
|
| 18 |
+
|
| 19 |
+
def numberedWord (q : Fin n ≃ ι) (e : Fin m ≃ κ) (w : κ → ι → Fin 4) :
|
| 20 |
+
Fin m → Fin n → Fin 4 := fun a i => w (e a) (q i)
|
| 21 |
+
|
| 22 |
+
private theorem tag_numbered (q : Fin n ≃ ι) (xs : List ι) (w : ι → Fin 4) :
|
| 23 |
+
QuantumOrderedLabelData.tag (index q) xs w =
|
| 24 |
+
((xs.map q.symm).map (fun i => (i.val,(w (q i)).val))) := by
|
| 25 |
+
simp only [QuantumOrderedLabelData.tag,List.map_map,Function.comp_def,
|
| 26 |
+
Equiv.apply_symm_apply,index]
|
| 27 |
+
|
| 28 |
+
theorem packed_table (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 29 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4) (J : κ → ℚ) :
|
| 30 |
+
(table e (index q) xs w J).map QuantumOrderedRawPacking.value =
|
| 31 |
+
QuantumRawExchange.packed (QuantumOrderedRawBlock.terms
|
| 32 |
+
(numberedSites q e xs) (numberedWord q e w)) (fun i => J (e i)) := by
|
| 33 |
+
simp only [table,List.map_ofFn,Function.comp_def,QuantumRawExchange.packed]
|
| 34 |
+
apply congrArg List.ofFn
|
| 35 |
+
funext i
|
| 36 |
+
rw [tag_numbered]
|
| 37 |
+
exact QuantumOrderedRawPacking.value_pack _ _ _
|
| 38 |
+
|
| 39 |
+
variable [Fintype ι] [DecidableEq ι] [Fintype κ]
|
| 40 |
+
|
| 41 |
+
omit [Fintype ι] [DecidableEq ι] [Fintype κ] in
|
| 42 |
+
theorem numbered_sites_length (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 43 |
+
(xs : κ → List ι) (i : Fin m) :
|
| 44 |
+
(numberedSites q e xs i).length=(xs (e i)).length := List.length_map _
|
| 45 |
+
|
| 46 |
+
omit [Fintype ι] [DecidableEq ι] [Fintype κ] in
|
| 47 |
+
theorem numbered_sites_nodup (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 48 |
+
(xs : κ → List ι) (hx : ∀ a, (xs a).Nodup) (i : Fin m) :
|
| 49 |
+
(numberedSites q e xs i).Nodup := (hx (e i)).map q.symm.injective
|
| 50 |
+
|
| 51 |
+
omit [DecidableEq ι] [Fintype κ] in
|
| 52 |
+
theorem numbered_support (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 53 |
+
(w : κ → ι → Fin 4) (i : Fin m) :
|
| 54 |
+
qmaPauliSupport (numberedWord q e w i)=
|
| 55 |
+
(qmaPauliSupport (w (e i))).map q.symm.toEmbedding :=
|
| 56 |
+
qmaPauliSupport_relabel q.symm (w (e i))
|
| 57 |
+
|
| 58 |
+
omit [Fintype κ] in
|
| 59 |
+
theorem numbered_cover (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 60 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4)
|
| 61 |
+
(hs : ∀ a, qmaPauliSupport (w a) ⊆ (xs a).toFinset) (i : Fin m) :
|
| 62 |
+
qmaPauliSupport (numberedWord q e w i) ⊆ (numberedSites q e xs i).toFinset := by
|
| 63 |
+
rw [numbered_support]
|
| 64 |
+
intro j hj
|
| 65 |
+
obtain ⟨a,ha,rfl⟩ := Finset.mem_map.mp hj
|
| 66 |
+
exact List.mem_toFinset.mpr (List.mem_map.mpr
|
| 67 |
+
⟨a,List.mem_toFinset.mp (hs (e i) ha),rfl⟩)
|
| 68 |
+
|
| 69 |
+
omit [DecidableEq ι] [Fintype κ] in
|
| 70 |
+
theorem numbered_private (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 71 |
+
(w : κ → ι → Fin 4)
|
| 72 |
+
(hp : ∀ a b, (qmaPauliSupport (w a)).card=2 →
|
| 73 |
+
qmaPauliSupport (w a)=qmaPauliSupport (w b) → a=b)
|
| 74 |
+
(i j : Fin m) (hi : (qmaPauliSupport (numberedWord q e w i)).card=2)
|
| 75 |
+
(hij : qmaPauliSupport (numberedWord q e w i)=
|
| 76 |
+
qmaPauliSupport (numberedWord q e w j)) : i=j := by
|
| 77 |
+
apply e.injective
|
| 78 |
+
apply hp (e i) (e j)
|
| 79 |
+
· simpa only [numbered_support,Finset.card_map] using hi
|
| 80 |
+
· rw [numbered_support,numbered_support] at hij
|
| 81 |
+
exact (Finset.map_injective q.symm.toEmbedding) hij
|
| 82 |
+
|
| 83 |
+
theorem numbered_energy (q : Fin n ≃ ι) (e : Fin m ≃ κ)
|
| 84 |
+
(w : κ → ι → Fin 4) (J : κ → ℝ) :
|
| 85 |
+
MediatorGraph.normalizedBottom (qmaPauliFamily (numberedWord q e w) (fun i => J (e i))) =
|
| 86 |
+
MediatorGraph.normalizedBottom (qmaPauliFamily w J) := by
|
| 87 |
+
have hw (i : Fin m) : qmaPauliWord (numberedWord q e w i) =
|
| 88 |
+
(qmaPauliWord (w (e i))).submatrix
|
| 89 |
+
(qmaQubitBasisEquiv q.symm) (qmaQubitBasisEquiv q.symm) :=
|
| 90 |
+
qmaPauliWord_relabel q.symm (w (e i))
|
| 91 |
+
have hm : qmaPauliFamily (numberedWord q e w) (fun i => J (e i)) =
|
| 92 |
+
(qmaPauliFamily w J).submatrix
|
| 93 |
+
(qmaQubitBasisEquiv q.symm) (qmaQubitBasisEquiv q.symm) := by
|
| 94 |
+
ext s t
|
| 95 |
+
simp only [qmaPauliFamily,Matrix.sum_apply,Matrix.smul_apply,
|
| 96 |
+
Matrix.submatrix_apply,hw,smul_eq_mul]
|
| 97 |
+
exact e.sum_comp (fun a => (J a:ℂ)*
|
| 98 |
+
qmaPauliWord (w a) (qmaQubitBasisEquiv q.symm s) (qmaQubitBasisEquiv q.symm t))
|
| 99 |
+
rw [hm]
|
| 100 |
+
exact MediatorGraph.normalizedBottom_reindex (qmaQubitBasisEquiv q.symm) _
|
| 101 |
+
|
| 102 |
+
end ContinuumCoulomb.QuantumOrderedLabelTable
|
| 103 |
+
|
| 104 |
+
end
|
| 105 |
+
|
| 106 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelPipeline.lean
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelBlocks
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelFamily
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! A fixed six-stage literal sparse-word compiler. The final stage assigns
|
| 7 |
+
a private mediator to every two-local term before the four-spin encoding. -/
|
| 8 |
+
|
| 9 |
+
noncomputable section
|
| 10 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelPipeline
|
| 11 |
+
open ExactQuantumFactoring.BitStackProgram
|
| 12 |
+
open QuantumOrderedLabelData QuantumOrderedLabelFamily
|
| 13 |
+
|
| 14 |
+
abbrev Input := QuantumOrderedLabelFamily.Input
|
| 15 |
+
abbrev State := QuantumOrderedLabelFamily.State
|
| 16 |
+
|
| 17 |
+
def fourWeight (r j : ℚ) := QuantumPolarizedSubdivision.weight r j
|
| 18 |
+
def sevenWeight (r j : ℚ) := QuantumPolarizedThird.weight r j
|
| 19 |
+
|
| 20 |
+
def subdivisionStep (d : ℕ) (x : Input) : Input :=
|
| 21 |
+
(x.1,value 4 (fun n xs => subdivision n d xs) fourWeight x)
|
| 22 |
+
def thirdStep (x : Input) : Input := (x.1,value 7 thirdBlock sevenWeight x)
|
| 23 |
+
def yyStep (x : Input) : Input := (x.1,value 4 yyBlock fourWeight x)
|
| 24 |
+
def privateStep (x : Input) : Input := (x.1,value 4 privateBlock fourWeight x)
|
| 25 |
+
def output (x : Input) : State :=
|
| 26 |
+
(privateStep (thirdStep (yyStep (thirdStep (subdivisionStep 2 (subdivisionStep 3 x)))))).2
|
| 27 |
+
|
| 28 |
+
noncomputable opaque subdivisionStepProgram (d : ℕ) : Procedure inputCode inputCode
|
| 29 |
+
(subdivisionStep d) :=
|
| 30 |
+
precisionProgram.pair (valueProgram 4 _ fourWeight
|
| 31 |
+
(blockProgram 4 _ fourWeight (subdivisionProgram d) QuantumOrderedWeightProgram.fourProgram))
|
| 32 |
+
noncomputable opaque thirdStepProgram : Procedure inputCode inputCode thirdStep :=
|
| 33 |
+
precisionProgram.pair (valueProgram 7 thirdBlock sevenWeight
|
| 34 |
+
(blockProgram 7 thirdBlock sevenWeight thirdBlockProgram QuantumOrderedWeightProgram.sevenProgram))
|
| 35 |
+
noncomputable opaque yyStepProgram : Procedure inputCode inputCode yyStep :=
|
| 36 |
+
precisionProgram.pair (valueProgram 4 yyBlock fourWeight
|
| 37 |
+
(blockProgram 4 yyBlock fourWeight yyBlockProgram QuantumOrderedWeightProgram.fourProgram))
|
| 38 |
+
noncomputable opaque privateStepProgram : Procedure inputCode inputCode privateStep :=
|
| 39 |
+
precisionProgram.pair (valueProgram 4 privateBlock fourWeight
|
| 40 |
+
(blockProgram 4 privateBlock fourWeight privateBlockProgram QuantumOrderedWeightProgram.fourProgram))
|
| 41 |
+
noncomputable opaque outputProgram : Procedure inputCode stateCode output :=
|
| 42 |
+
(Procedure.second unaryCode stateCode).comp (privateStepProgram.comp
|
| 43 |
+
(thirdStepProgram.comp (yyStepProgram.comp (thirdStepProgram.comp
|
| 44 |
+
((subdivisionStepProgram 2).comp (subdivisionStepProgram 3))))))
|
| 45 |
+
|
| 46 |
+
noncomputable def certificate : Turing.TM2ComputableInPolyTime inputCode stateCode output :=
|
| 47 |
+
outputProgram.toTM2
|
| 48 |
+
|
| 49 |
+
theorem output_length (x : Input) : (output x).2.length=12544*x.2.2.length := by
|
| 50 |
+
simp only [output,privateStep,thirdStep,yyStep,subdivisionStep,value,family_length]
|
| 51 |
+
omega
|
| 52 |
+
|
| 53 |
+
theorem output_qubits (x : Input) : (output x).1=x.2.1+3717*x.2.2.length := by
|
| 54 |
+
simp only [output,privateStep,thirdStep,yyStep,subdivisionStep,value,family_length]
|
| 55 |
+
omega
|
| 56 |
+
|
| 57 |
+
end ContinuumCoulomb.QuantumOrderedLabelPipeline
|
| 58 |
+
|
| 59 |
+
end
|
| 60 |
+
|
| 61 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelProgram.lean
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelSubdivision
|
| 2 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedRawPackingProgram
|
| 3 |
+
|
| 4 |
+
namespace OAI
|
| 5 |
+
|
| 6 |
+
/-! Polynomial list programs for the literal support-label operations.
|
| 7 |
+
Only constant-length prefixes are split in the early gadget compiler. -/
|
| 8 |
+
|
| 9 |
+
noncomputable section
|
| 10 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelData
|
| 11 |
+
open ExactQuantumFactoring.BitStackProgram
|
| 12 |
+
|
| 13 |
+
abbrev labelCode := QuantumOrderedRawPacking.letterCode
|
| 14 |
+
abbrev labelsCode := listCode labelCode
|
| 15 |
+
|
| 16 |
+
noncomputable def takeProgram (d : ℕ) : Procedure labelsCode labelsCode
|
| 17 |
+
(fun xs => xs.take d) := by
|
| 18 |
+
induction d with
|
| 19 |
+
| zero => exact (Procedure.constant labelsCode labelsCode []).congrFun (by intro xs; rfl)
|
| 20 |
+
| succ d ih =>
|
| 21 |
+
let cons := (Procedure.listCons labelCode).comp
|
| 22 |
+
((Procedure.listHead labelCode (0,0)).pair (ih.comp (Procedure.listTail labelCode)))
|
| 23 |
+
exact (Procedure.conditional (Procedure.listEmpty labelCode)
|
| 24 |
+
(Procedure.constant labelsCode labelsCode []) cons).congrFun (by
|
| 25 |
+
intro xs
|
| 26 |
+
cases xs <;> rfl)
|
| 27 |
+
|
| 28 |
+
noncomputable def dropProgram (d : ℕ) : Procedure labelsCode labelsCode
|
| 29 |
+
(fun xs => xs.drop d) :=
|
| 30 |
+
(Procedure.listDrop labelCode).comp
|
| 31 |
+
((Procedure.constant labelsCode Nat.bits d).pair (Procedure.identity labelsCode))
|
| 32 |
+
|
| 33 |
+
def oddLetters (xs : List Letter) : Bool :=
|
| 34 |
+
xs.foldr (fun a b => xor (decide (a.2=2)) b) false
|
| 35 |
+
|
| 36 |
+
private theorem oddLetters_eq (xs : List Letter) :
|
| 37 |
+
oddLetters xs=decide (Odd (yCount xs)) := by
|
| 38 |
+
induction xs with
|
| 39 |
+
| nil => rfl
|
| 40 |
+
| cons a xs ih =>
|
| 41 |
+
change xor (decide (a.2=2)) (oddLetters xs)=_
|
| 42 |
+
rw [ih]
|
| 43 |
+
by_cases ha : a.2=2
|
| 44 |
+
· have hc : yCount (a::xs)=yCount xs+1 := by simp [yCount,ha]
|
| 45 |
+
simp only [hc,Nat.odd_add_one,ha,decide_true,Bool.true_xor,decide_not]
|
| 46 |
+
· have hc : yCount (a::xs)=yCount xs := by simp [yCount,ha]
|
| 47 |
+
rw [hc]
|
| 48 |
+
simp [ha]
|
| 49 |
+
|
| 50 |
+
private theorem fold_oddLetters (xs : List Letter) (b : Bool) :
|
| 51 |
+
xs.foldl (fun b a => xor (decide (a.2=2)) b) b=xor (oddLetters xs) b := by
|
| 52 |
+
induction xs generalizing b with
|
| 53 |
+
| nil => simp [oddLetters]
|
| 54 |
+
| cons a xs ih =>
|
| 55 |
+
rw [List.foldl_cons,ih]
|
| 56 |
+
change xor (oddLetters xs) (xor (decide (a.2=2)) b)=
|
| 57 |
+
xor (xor (decide (a.2=2)) (oddLetters xs)) b
|
| 58 |
+
cases b <;> cases ha : decide (a.2=2) <;> cases hx : oddLetters xs <;> rfl
|
| 59 |
+
|
| 60 |
+
noncomputable opaque oddProgram : Procedure labelsCode Procedure.boolCode
|
| 61 |
+
(fun xs => decide (Odd (yCount xs))) := by
|
| 62 |
+
let head := Procedure.first labelCode Procedure.boolCode
|
| 63 |
+
let letter := (Procedure.second Nat.bits Nat.bits).comp head
|
| 64 |
+
let test := Procedure.binaryEq.comp
|
| 65 |
+
(letter.pair (Procedure.constant (prodCode labelCode Procedure.boolCode) Nat.bits 2))
|
| 66 |
+
let state := Procedure.second labelCode Procedure.boolCode
|
| 67 |
+
let step := Procedure.boolXor.comp (test.pair state)
|
| 68 |
+
let fold := Procedure.foldList (0,0) step (Polynomial.C 1) (by
|
| 69 |
+
intro xs b i
|
| 70 |
+
simp only [Procedure.boolCode,List.length_singleton,Polynomial.eval_C]
|
| 71 |
+
exact le_rfl)
|
| 72 |
+
exact (fold.comp ((Procedure.identity labelsCode).pair
|
| 73 |
+
(Procedure.constant labelsCode Procedure.boolCode false))).congrFun (by
|
| 74 |
+
intro xs
|
| 75 |
+
simp only [Function.comp_apply,id_eq,fold_oddLetters,Bool.xor_false,oddLetters_eq])
|
| 76 |
+
|
| 77 |
+
noncomputable opaque axisProgram : Procedure labelsCode Nat.bits axis :=
|
| 78 |
+
(Procedure.conditional oddProgram (Procedure.constant labelsCode Nat.bits 2)
|
| 79 |
+
(Procedure.constant labelsCode Nat.bits 1)).congrFun (by
|
| 80 |
+
intro xs
|
| 81 |
+
simp only [axis,decide_eq_true_eq])
|
| 82 |
+
|
| 83 |
+
abbrev BlockInput := ℕ × List Letter
|
| 84 |
+
abbrev blockCode := prodCode Nat.bits labelsCode
|
| 85 |
+
noncomputable opaque mediatorProgram : Procedure blockCode Nat.bits Prod.fst := Procedure.first _ _
|
| 86 |
+
noncomputable opaque labelsProgram : Procedure blockCode labelsCode Prod.snd := Procedure.second _ _
|
| 87 |
+
noncomputable opaque prefixProgram (d : ℕ) : Procedure blockCode labelsCode
|
| 88 |
+
(fun x => x.2.take d) := (takeProgram d).comp labelsProgram
|
| 89 |
+
noncomputable opaque suffixProgram (d : ℕ) : Procedure blockCode labelsCode
|
| 90 |
+
(fun x => x.2.drop d) := (dropProgram d).comp labelsProgram
|
| 91 |
+
noncomputable opaque mediatorLabelProgram (d : ℕ) : Procedure blockCode labelCode
|
| 92 |
+
(fun x => (x.1,axis (x.2.take d))) :=
|
| 93 |
+
mediatorProgram.pair (axisProgram.comp (prefixProgram d))
|
| 94 |
+
noncomputable def singletonProgram {α : Type} {ea : α → List Bool}
|
| 95 |
+
(f : α → Letter) (p : Procedure ea labelCode f) :
|
| 96 |
+
Procedure ea labelsCode (fun x => [f x]) :=
|
| 97 |
+
(Procedure.listCons labelCode).comp (p.pair (Procedure.constant ea labelsCode []))
|
| 98 |
+
|
| 99 |
+
noncomputable opaque subdivisionProgram (d : ℕ) (k : Fin 4) :
|
| 100 |
+
Procedure blockCode labelsCode (fun x => subdivision x.1 d x.2 k) := by
|
| 101 |
+
refine Fin.cases ?_ (fun k => ?_) k
|
| 102 |
+
· exact Procedure.constant blockCode labelsCode []
|
| 103 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 104 |
+
· exact singletonProgram (fun x : BlockInput => (x.1,3))
|
| 105 |
+
(mediatorProgram.pair (Procedure.constant blockCode Nat.bits 3))
|
| 106 |
+
· refine Fin.cases ?_ (fun k => ?_) k
|
| 107 |
+
· exact (Procedure.listAppend labelCode (0,0)).comp
|
| 108 |
+
((prefixProgram d).pair (singletonProgram _ (mediatorLabelProgram d)))
|
| 109 |
+
· refine Fin.cases ?_ (fun k => Fin.elim0 k) k
|
| 110 |
+
exact (Procedure.listAppend labelCode (0,0)).comp
|
| 111 |
+
((suffixProgram d).pair (singletonProgram _ (mediatorLabelProgram d)))
|
| 112 |
+
|
| 113 |
+
end ContinuumCoulomb.QuantumOrderedLabelData
|
| 114 |
+
|
| 115 |
+
end
|
| 116 |
+
|
| 117 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelSubdivision.lean
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelData
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Literal bounded arrays for polarized subdivision. The exact array
|
| 6 |
+
identity below keeps the supplied site order and the matching mediator. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelData
|
| 10 |
+
open scoped Classical
|
| 11 |
+
|
| 12 |
+
variable {ι κ : Type} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ]
|
| 13 |
+
|
| 14 |
+
def subdivision (mediator d : ℕ) (xs : List Letter) : Fin 4 → List Letter :=
|
| 15 |
+
![[],[(mediator,3)],xs.take d++[(mediator,axis (xs.take d))],
|
| 16 |
+
xs.drop d++[(mediator,axis (xs.take d))]]
|
| 17 |
+
|
| 18 |
+
omit [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] in
|
| 19 |
+
theorem tag_lift (index : ι → ℕ) (slot : κ → ℕ) (xs : List ι)
|
| 20 |
+
(w : ι → Fin 4) (v : κ → Fin 4) :
|
| 21 |
+
tag (Sum.elim index slot) (xs.map Sum.inl) (Sum.elim w v) =tag index xs w := by
|
| 22 |
+
simp only [tag,List.map_map,Function.comp_def,Sum.elim_inl]
|
| 23 |
+
|
| 24 |
+
omit [Fintype ι] [Fintype κ] [DecidableEq ι] in
|
| 25 |
+
theorem tag_appendMediator (index : ι → ℕ) (slot : κ → ℕ) (xs : List ι)
|
| 26 |
+
(w : ι → Fin 4) (e : κ) (a : Fin 4) :
|
| 27 |
+
tag (Sum.elim index slot) (QuantumOrderedSubdivision.appendMediator xs e)
|
| 28 |
+
(Sum.elim w (qmaSinglePauliWord e a)) =tag index xs w++[(slot e,a.val)] := by
|
| 29 |
+
simp only [QuantumOrderedSubdivision.appendMediator,tag,List.map_append,List.map_map,
|
| 30 |
+
Function.comp_def,Sum.elim_inl,List.map_cons,List.map_nil,Sum.elim_inr,
|
| 31 |
+
qmaSinglePauliWord,ite_true]
|
| 32 |
+
|
| 33 |
+
omit [Fintype ι] [Fintype κ] [DecidableEq κ] in
|
| 34 |
+
theorem first_tag (index : ι → ℕ) (xs : List ι) (w : ι → Fin 4) (d : ℕ) :
|
| 35 |
+
tag index (xs.take d) (QuantumOrderedSplit.firstWord xs d w) =
|
| 36 |
+
(tag index xs w).take d := by
|
| 37 |
+
rw [QuantumOrderedSplit.firstWord,QuantumOrderedSplit.left,
|
| 38 |
+
tag_restrict index (xs.take d) w (xs.take d) (fun _ h => h),tag_take]
|
| 39 |
+
|
| 40 |
+
omit [Fintype ι] [Fintype κ] [DecidableEq κ] in
|
| 41 |
+
theorem second_tag (index : ι → ℕ) (xs : List ι) (w : ι → Fin 4) (d : ℕ) :
|
| 42 |
+
tag index (xs.drop d) (QuantumOrderedSplit.secondWord xs d w) =
|
| 43 |
+
(tag index xs w).drop d := by
|
| 44 |
+
rw [QuantumOrderedSplit.secondWord,QuantumOrderedSplit.right,
|
| 45 |
+
tag_restrict index (xs.drop d) w (xs.drop d) (fun _ h => h),tag_drop]
|
| 46 |
+
|
| 47 |
+
omit [Fintype κ] [DecidableEq κ] in
|
| 48 |
+
theorem first_axis (index : ι → ℕ) (xs : List ι) (w : ι → Fin 4)
|
| 49 |
+
(hx : xs.Nodup) (d : ℕ) :
|
| 50 |
+
axis ((tag index xs w).take d) =
|
| 51 |
+
(QuantumPolarizedSubdivision.axis
|
| 52 |
+
(decide (Odd (qmaPauliYCount (QuantumOrderedSplit.firstWord xs d w))))).val := by
|
| 53 |
+
have hc := yCount_tag index (xs.take d) (QuantumOrderedSplit.firstWord xs d w)
|
| 54 |
+
(hx.sublist (List.take_sublist d xs)) (qmaPauliRestrict_support _ _)
|
| 55 |
+
rw [first_tag] at hc
|
| 56 |
+
simp only [axis,hc,QuantumPolarizedSubdivision.axis,decide_eq_true_eq]
|
| 57 |
+
split_ifs <;> rfl
|
| 58 |
+
|
| 59 |
+
omit [Fintype κ] in
|
| 60 |
+
theorem subdivision_tag (index : ι → ℕ) (slot : κ → ℕ)
|
| 61 |
+
(xs : κ → List ι) (w : κ → ι → Fin 4)
|
| 62 |
+
(hx : ∀ e, (xs e).Nodup) (d : ℕ) (p : κ × Fin 4) :
|
| 63 |
+
tag (Sum.elim index slot) (QuantumOrderedSubdivision.outputSites xs d p)
|
| 64 |
+
(QuantumOrderedSubdivision.outputWord xs d w p) =
|
| 65 |
+
subdivision (slot p.1) d (tag index (xs p.1) (w p.1)) p.2 := by
|
| 66 |
+
rcases p with ⟨e,k⟩
|
| 67 |
+
fin_cases k
|
| 68 |
+
· rfl
|
| 69 |
+
· change tag (Sum.elim index slot) [Sum.inr e]
|
| 70 |
+
(Sum.elim (fun _ : ι => 0) (qmaSinglePauliWord e 3)) = [(slot e,3)]
|
| 71 |
+
simp only [tag,List.map_cons,List.map_nil,Sum.elim_inr,qmaSinglePauliWord,ite_true]
|
| 72 |
+
rfl
|
| 73 |
+
· change tag (Sum.elim index slot) (QuantumOrderedSubdivision.appendMediator ((xs e).take d) e)
|
| 74 |
+
(Sum.elim (QuantumOrderedSplit.firstWord (xs e) d (w e))
|
| 75 |
+
(qmaSinglePauliWord e (QuantumPolarizedSubdivision.axis
|
| 76 |
+
(QuantumOrderedSubdivision.phase xs d w e)))) =
|
| 77 |
+
(tag index (xs e) (w e)).take d ++
|
| 78 |
+
[(slot e,axis ((tag index (xs e) (w e)).take d))]
|
| 79 |
+
rw [tag_appendMediator,first_tag,first_axis index (xs e) (w e) (hx e)]
|
| 80 |
+
rfl
|
| 81 |
+
· change tag (Sum.elim index slot) (QuantumOrderedSubdivision.appendMediator ((xs e).drop d) e)
|
| 82 |
+
(Sum.elim (QuantumOrderedSplit.secondWord (xs e) d (w e))
|
| 83 |
+
(qmaSinglePauliWord e (QuantumPolarizedSubdivision.axis
|
| 84 |
+
(QuantumOrderedSubdivision.phase xs d w e)))) =
|
| 85 |
+
(tag index (xs e) (w e)).drop d ++
|
| 86 |
+
[(slot e,axis ((tag index (xs e) (w e)).take d))]
|
| 87 |
+
rw [tag_appendMediator,second_tag,first_axis index (xs e) (w e) (hx e)]
|
| 88 |
+
rfl
|
| 89 |
+
|
| 90 |
+
end ContinuumCoulomb.QuantumOrderedLabelData
|
| 91 |
+
|
| 92 |
+
end
|
| 93 |
+
|
| 94 |
+
end OAI
|
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Quantum/QuantumOrderedLabelTable.lean
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import OAI.MathematicalPhysics.ContinuumCoulomb.Quantum.QuantumOrderedLabelFamily
|
| 2 |
+
|
| 3 |
+
namespace OAI
|
| 4 |
+
|
| 5 |
+
/-! Ordered finite tables and their literal product enumeration. These
|
| 6 |
+
identities compare the computed lists with the actual finite Pauli family. -/
|
| 7 |
+
|
| 8 |
+
noncomputable section
|
| 9 |
+
namespace ContinuumCoulomb.QuantumOrderedLabelTable
|
| 10 |
+
open QuantumOrderedLabelData QuantumOrderedLabelFamily
|
| 11 |
+
open scoped BigOperators Classical
|
| 12 |
+
|
| 13 |
+
variable {ι κ : Type} {m n d : ℕ}
|
| 14 |
+
|
| 15 |
+
def table (e : Fin m ≃ κ) (index : ι → ℕ) (xs : κ → List ι)
|
| 16 |
+
(w : κ → ι → Fin 4) (J : κ → ℚ) : List Entry :=
|
| 17 |
+
List.ofFn (fun i => (tag index (xs (e i)) (w (e i)),J (e i)))
|
| 18 |
+
|
| 19 |
+
def nextTerm (e : Fin m ≃ κ) (d : ℕ) : Fin (m*d) ≃ κ × Fin d :=
|
| 20 |
+
finProdFinEquiv.symm.trans (Equiv.prodCongr e (Equiv.refl _))
|
| 21 |
+
|
| 22 |
+
def index (q : Fin n ≃ ι) (i : ι) : ℕ := (q.symm i).val
|
| 23 |
+
|
| 24 |
+
def nextQubit (q : Fin n ≃ ι) (e : Fin m ≃ κ) : Fin (n+m) ≃ ι ⊕ κ :=
|
| 25 |
+
finSumFinEquiv.symm.trans (Equiv.sumCongr q e)
|
| 26 |
+
|
| 27 |
+
theorem nextQubit_index (q : Fin n ≃ ι) (e : Fin m ≃ κ) :
|
| 28 |
+
index (nextQubit q e) = Sum.elim (index q) (fun a => n+(e.symm a).val) := by
|
| 29 |
+
funext a
|
| 30 |
+
cases a <;> simp [index,nextQubit]
|
| 31 |
+
|
| 32 |
+
private theorem lookup_ofFn {α : Type} (v : Fin m → α) (fallback : α) (i : Fin m) :
|
| 33 |
+
((List.ofFn v).drop i.val).headD fallback=v i := by
|
| 34 |
+
rw [List.drop_eq_getElem_cons (by simpa only [List.length_ofFn] using i.isLt)]
|
| 35 |
+
simp only [List.headD_cons,List.getElem_ofFn]
|
| 36 |
+
|
| 37 |
+
theorem product_table {α : Type} (v : Fin m × Fin d → α) :
|
| 38 |
+
List.ofFn (fun i => v (finProdFinEquiv.symm i)) =
|
| 39 |
+
(List.ofFn (fun a => List.ofFn (fun b => v (a,b)))).flatten := by
|
| 40 |
+
rw [List.ofFn_mul]
|
| 41 |
+
apply congrArg List.flatten
|
| 42 |
+
apply congrArg List.ofFn
|
| 43 |
+
funext a
|
| 44 |
+
apply congrArg List.ofFn
|
| 45 |
+
funext b
|
| 46 |
+
have h : finProdFinEquiv (a,b) =
|
| 47 |
+
(⟨a.val*d+b.val,by nlinarith [a.isLt,b.isLt]⟩ : Fin (m*d)) := by
|
| 48 |
+
apply Fin.ext
|
| 49 |
+
change b.val+d*a.val=a.val*d+b.val
|
| 50 |
+
ac_rfl
|
| 51 |
+
rw [← h,Equiv.symm_apply_apply]
|
| 52 |
+
|
| 53 |
+
variable [Fintype κ]
|
| 54 |
+
|
| 55 |
+
theorem radius_table (e : Fin m ≃ κ) (ix : ι → ℕ) (xs : κ → List ι)
|
| 56 |
+
(w : κ → ι → Fin 4) (J : κ → ℚ) (N n : ℕ) :
|
| 57 |
+
radius (N,n,table e ix xs w J)=QuantumOrderedSubdivision.scale J N := by
|
| 58 |
+
simp only [radius,weights,table,List.map_ofFn,Function.comp_def,List.sum_ofFn,
|
| 59 |
+
QuantumOrderedWeightProgram.scale,QuantumOrderedSubdivision.scale,
|
| 60 |
+
QuantumOrderedSubdivision.budget]
|
| 61 |
+
rw [e.sum_comp (fun a => (1+|J a|)^2)]
|
| 62 |
+
|
| 63 |
+
/-- A literal stage is the same product-ordered finite table as its supplied
|
| 64 |
+
word and coefficient formulas. The hypotheses are pointwise identities. -/
|
| 65 |
+
theorem family_table (e : Fin m ≃ κ) (ix : ι → ℕ) (xs : κ → List ι)
|
| 66 |
+
(w : κ → ι → Fin 4) (J : κ → ℚ) (N n : ℕ)
|
| 67 |
+
(f : ℕ → List Letter → Fin d → List Letter)
|
| 68 |
+
(g : ℚ → ℚ → Fin d → ℚ) :
|
| 69 |
+
family d f g (N,n,table e ix xs w J) =
|
| 70 |
+
List.ofFn (fun i : Fin (m*d) =>
|
| 71 |
+
let p := nextTerm e d i
|
| 72 |
+
(f (n+(e.symm p.1).val) (tag ix (xs p.1) (w p.1)) p.2,
|
| 73 |
+
g (QuantumOrderedSubdivision.scale J N) (J p.1) p.2)) := by
|
| 74 |
+
let v : Fin m → Entry := fun i => (tag ix (xs (e i)) (w (e i)),J (e i))
|
| 75 |
+
have hr := radius_table e ix xs w J N n
|
| 76 |
+
have hrows : (List.range m).map (fun i =>
|
| 77 |
+
block d f g ((n+i,radius (N,n,table e ix xs w J)),((List.ofFn v).drop i).headD ([],0))) =
|
| 78 |
+
List.ofFn (fun a : Fin m => block d f g
|
| 79 |
+
((n+a.val,QuantumOrderedSubdivision.scale J N),v a)) := by
|
| 80 |
+
apply List.ext_getElem
|
| 81 |
+
· simp
|
| 82 |
+
· intro i hi hj
|
| 83 |
+
have hi' : i < m := by simpa using hi
|
| 84 |
+
simp only [List.getElem_map,List.getElem_range,List.getElem_ofFn]
|
| 85 |
+
rw [hr,lookup_ofFn v ([],0) ⟨i,hi'⟩]
|
| 86 |
+
change ((List.range (List.ofFn v).length).map (fun i =>
|
| 87 |
+
block d f g ((n+i,radius (N,n,table e ix xs w J)),((List.ofFn v).drop i).headD ([],0)))).flatten = _
|
| 88 |
+
rw [List.length_ofFn,hrows]
|
| 89 |
+
symm
|
| 90 |
+
convert product_table (fun p : Fin m × Fin d =>
|
| 91 |
+
(f (n+p.1.val) (v p.1).1 p.2,
|
| 92 |
+
g (QuantumOrderedSubdivision.scale J N) (v p.1).2 p.2)) using 1
|
| 93 |
+
· congr 1
|
| 94 |
+
funext i
|
| 95 |
+
simp only [nextTerm,Equiv.trans_apply,Equiv.prodCongr_apply,Prod.map_fst,Prod.map_snd,
|
| 96 |
+
Equiv.refl_apply,Equiv.symm_apply_apply,v]
|
| 97 |
+
· rfl
|
| 98 |
+
|
| 99 |
+
end ContinuumCoulomb.QuantumOrderedLabelTable
|
| 100 |
+
|
| 101 |
+
end
|
| 102 |
+
|
| 103 |
+
end OAI
|