Skip to content

v8.3.4

Latest

Choose a tag to compare

@tatopenn-cell tatopenn-cell released this 09 Nov 14:51
· 6 commits to main since this release
e9d5f37

Dense-Evolution 8.3.4

The Composer of the documentation site now runs in the browser with no kernel to install, and a circuit can be drawn in Quirk at any size. The package gains a NumPy matrix product state simulator and NumPy QAOA and VQE. There is no change to the public API of dense_evolution (the new files are in dense_evolution/backends/ and are not in __all__).

PyPI: https://pypi.org/project/dense-evolution/8.3.4/

New in the package

  • MPSSimulatorNumpy (dense_evolution/backends/mps_numpy.py, #396): the matrix product state simulator in NumPy, with the gates, the bond search, the Pauli expectation value and the most probable states. It imports only math, heapq, warnings and NumPy, so it runs where JAX does not (Pyodide in a browser). The state is complex64 by default and complex128 on request.
  • qasm_subset (dense_evolution/backends/qasm_subset.py): an OpenQASM 2.0 parser for that simulator, with no eval and line-numbered ValueError.
  • QAOA and VQE in NumPy (dense_evolution/backends/variational_numpy.py, #402): vqe, qaoa, qaoa_expectation, qaoa_gradient, energy, hardware_efficient_ops, maxcut_terms, exact_maxcut. Gradients by the parameter-shift rule, optimisation by Adam, state and parameters in single or double precision. hardware_efficient_ops and vqe take an optional edges list for the entangler (the default is the ladder of the dashboard's VQE, so nothing changes for a caller that does not pass it).
  • Continuous integration: every check runs in under 20 minutes (#397).

New in the Composer (documentation site, /composer/)

  • Run in the browser, no install (#398, #399): the button "Prova nel browser" runs the NumPy simulator in the page (Pyodide). Shots, statevector, circuit diagram, histogram, Q-sphere and Bloch spheres up to the qubit limit; above it, up to 1500 qubits, the most probable states. Settings and OpenQASM on the left, circuit and results on the right.
  • The qubit limit comes from the memory of the browser (#409): from navigator.deviceMemory and the heap of Pyodide measured at 20, 22 and 24 qubits, with a floor of 16, a ceiling of 24 and 15% of the memory kept free. A browser that does not report its memory gets 16, and the page says so.
  • Quirk as the circuit editor (#400, #403, #405): draw the circuit in Quirk and compile it to OpenQASM, or write OpenQASM and draw it in Quirk, with the buttons "Compila verso Dense" and "Compila verso Quirk" and an Auto switch for the copy in both directions. Quirk draws and edits circuits of any number of wires, up to 1500; above 16 wires it does not simulate, so its own displays are absent and the engine of the page runs the OpenQASM.
  • Presets from the library of the dashboard (#404): the 20 circuits of QASM_LIBRARY, plus the larger GHZ and QFT circuits that only the page generates.
  • Noise (#406): the six models of the local kernel (ideal, depolarizing, bitflip, phaseflip, amplitude_damping, combined), as one stochastic Kraus trajectory on the final state, with the fidelity against the ideal state.
  • Topology panel, input qubits, tables of a run (#407): the five patterns of entangling_layer (linear, circular, full, star, brick) with gate, reverse direction, hub and a Hadamard layer, loaded into the OpenQASM box; the qubits that start in |1>; the tabs "Per qubit" (P(1) of each qubit) and "Outcomes" (the shots of each outcome).
  • VQE and QAOA in the browser (#408): VQE on the six molecules of the catalogue (their qubit Hamiltonians were written from the real code) with the hardware-efficient ansatz and an entangler chosen among the five patterns; QAOA for MaxCut on the graph of a pattern. Single or double precision, energy history chart, the circuit can be loaded into the OpenQASM box.
  • Zero-noise extrapolation in the browser (#410): Richardson through three noise scales or a degree-2 fit through five, from 200 noisy trajectories at each scale, the same numbers as the local kernel for the same state and seed.
  • Installers (#401): working download links, and the offline copy of the Composer keeps the Quirk editor.

Still on the local kernel

Custom molecules (Hartree-Fock), the scan of a bond length, forces and molecular dynamics, the density-matrix ZNE and the UCCSD ansatz need PennyLane or JAX and are hidden in browser mode.

Install

pip install dense-evolution==8.3.4