PennyLaneAI / qml

Introductions to key concepts in quantum programming, as well as tutorials and implementations from cutting-edge quantum computing research.
https://pennylane.ai/qml
Apache License 2.0
532 stars 185 forks source link

[BUG] Measurement optimization demo slight diff in # Hamiltonian terms for `v0.23.0` #468

Closed antalszava closed 1 year ago

antalszava commented 2 years ago

This is just a note that the measurement optimization demonstration outputs slightly more terms (2050 -> 2110) with PennyLane v0.23.0 (at the time of writing v0.23.0 has a release candidate branch).

The update to the demo required was being done in https://github.com/PennyLaneAI/qml/pull/467.

See new outputs of the demo:

New measurement_optimize outputs (warning: original output over 2000 lines long; terms replaced by the ======================= string):

More Required number of qubits: 4 ======================= Expectation value of XYI = 0.043303497361638466 Expectation value of XIZ = -0.014466813606153945 [0.25067393 0.00195986 0.23037242 0.00149689 0.23943888 0.00704006 0.26433778 0.00468018] Expectation value of XYI = 0.04330349736163853 Expectation value of XIZ = -0.014466813606153591 [ 0.0433035 -0.01446681] [RY(-1.5707963267948966, wires=[0]), RX(1.5707963267948966, wires=[1])] [PauliZ(wires=[0]) @ PauliZ(wires=[1]), PauliZ(wires=[0]) @ PauliZ(wires=[2])] Minimum number of QWC groupings found: 2 Group 0: Y0 X2 X3 Y0 Y1 X2 X3 X2 X3 Group 1: Z0 Z1 Z2 Z0 Z1 Z2 Z3 Z0 Z0 Z1 Term expectation values: Group 0 expectation values: [ 0.27492493 0.00402838 -0.0102099 ] Group 1 expectation values: [0.99865999 0.98385723 0.95656064 0.98498103] = 4.1928023038789375 4.192802303878938 Number of Hamiltonian terms/required measurements: 2110 Number of required measurements after optimization: 556
KetpuntoG commented 1 year ago

I see this is resolved, thank you @antalszava ! 😄