Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Effort-based versioning.
Unreleased¶
Added¶
transpile_mpo_to_circuit: convenience wrapper chaininginit_cost_tn,find_transfer_structure,build_first_sweepandoptimize_single_gate_updateto fit a brickwall circuit ansatz to a reference MPO in one call.init_cost_tnandtranspile_mpo_to_circuitare now re-exported fromqpe_toolbox.circuit.state_preparation_mpois now re-exported fromqpe_toolbox.tensor.trotter_approx_as_MPOis now re-exported fromqpe_toolbox.hamiltonian.optimize_single_gate_update/transpile_mpo_to_circuit: keyword-onlyoptimizeargument selecting the contraction strategy of each gate’s local environment.
Changed¶
init_cost_tn: replacedseed(int) with anrng(numpy.random.Generator) argument, consistent with the rest of the codebase.Trotter-Suzuki MPO functions (
trotter_approx_as_MPO,trotter1_approx_as_MPO,trotter2_approx_as_MPO,trotter4_approx_as_MPO,exp_Pauli_string_as_MPO) moved fromqpe_toolbox.circuit.mpo_circuit_transpilationtoqpe_toolbox.hamiltonian.trotterization, androtation_gatesmoved there fromqpe_toolbox.hamiltonian.hamiltonian.state_preparation_mpomoved toqpe_toolbox.tensor.mpomps_tools. Importing the Trotter functions orstate_preparation_mpofromqpe_toolbox.circuit.mpo_circuit_transpilationnow raisesImportError;rotation_gatescan still be imported from its old module.trotter_approx_as_MPO: renamedordertotrotter_order, consistent withHamiltonian.get_trotter_stepand every QPE/RPE function in the codebase.dtis now positional, andtrotter_order,cutoffandmax_bonddefault to1,1e-10andNone.trotter1_approx_as_MPO/trotter2_approx_as_MPO/trotter4_approx_as_MPO: take aHamiltonianand a positionaldtinstead ofham_terms, n_qubitsand a keyword-onlydt.cutoffandmax_bonddefault to1e-10andNone.exp_Pauli_string_as_MPO: signature changed from(ham_term, n_qubits, *, theta)to(term, dt, n_qubits), and it now buildsexp(-i * dt * coeff * P), matchingrotation_gatesand the Trotter functions: passdt = -thetato recover the oldexp(i * theta * coeff * P). It also raisesValueErrorif a qubit is repeated or out of range.state_preparation_mpo: raisesValueErrorunless the MPS arrays are in'lpr'order (as returned byDMRG2), instead of silently building a wrong MPO.optimize_single_gate_update: now returns(cost_tn, contracted_envs, overlap), whereoverlapis normalized by2**n_qubits.mpo_circuit_transpilationhelpers:update_dict_contr_envsrenamed toupdate_contracted_envs; it andupdate_cost_tntake a single gate tensor instead of a list. Argumentsdict_transf,dict_contr_envsandxrenamed totransfer_structure,contracted_envsandsite_index.tn_fit:tags,steps,tolandcontract_optimizeare now keyword-only. A progress bar is always shown; setTQDM_DISABLE=1before importingtqdmto silence it. RaisesTypeErroron parametrized tensors, andValueErroriftagsselects anything other than whole two-qubit gates (e.g. gates split by quimb’s defaultgate_contract).tags=Noneis no longer supported, as it never worked on a circuit state.robust_phase_estimation: replacedepsilonwithn_repetitions, removedsign_E0, added anrngargument for deterministic sampling, added at0argument setting the base evolution time, and changed thetrotter_orderdefault from 2 to 1. The estimated phase is nowE0 * t0, so the energy is recovered astheta / t0. The returned list now has lengthn_repetitions(no leading placeholder).run_hadamard_test/rpe_get_hadamard_output: replacedseedwith anrng(numpy.random.Generator) argument.build_hadamard_test_circuit/run_hadamard_test: renamed thethetaargument tophase_gate_angle.rpe_get_hadamard_output: renamed themargument toevolution_time. It now takes the evolution time itself instead of the exponentm; callers passingmpositionally must pass2**mto keep the previous behaviour.Renamed
rpe_distancetoangular_distance; it is now vectorized.rpe_update_theta: signature changed to(phi_m, theta_ref, m), now returning a single angle.optunadependency moved from core dependency to recommended.draw_layered_circuit/draw_layered_expval: replaced thelist_namesargument with three keyword-only argumentsstate_label,labels_1qubitandlabels_2qubit. A label list shorter than the circuit depth now raisesValueErrorinstead of failing with anIndexErrorwhile drawing.
Removed¶
rpe_distance(renamed toangular_distance).hyperoptimizationexample and all QAOA-related code:examples/hyperoptimization.py,src/qpe_toolbox/circuit/qaoa.pyandtests/test_qaoa.py. This removesbrute_force_maxcut,compute_qaoa_contraction_costsandstudy_optimization_time_costsfromqpe_toolbox.circuit.tn_fit: theprogbarargument.PRC_loc_cost_tn, inlined into the newoptimize_one_gate.two_qubit_rand_layer: thereverseargument. It only changed the order in which overlapping gates were applied, and never the control direction its documentation claimed.
Fixed¶
draw_layered_expval: two-qubit layer labels were indexed in the opposite direction to single-qubit ones, so the two label lists disagreed on which layer they were naming.draw_layered_circuit/draw_layered_expval: unlabelled diagrams drew['']next to every qubit instead of nothing.trotter4_approx_as_MPO: the 4th-order Suzuki “triple-jump” composition applied its middle-layer factor twice instead of sandwiching it between two applications of the outer-layer factor, sotrotter_order=4was less accurate thantrotter_order=1. The error of a single step now scales asdt**5.exp_Pauli_string_as_MPO: Pauli letters were assigned in increasing qubit order, so terms listing their qubits unsorted put the letters on the wrong qubits.exp_Pauli_string_as_MPO: the MPO was compressed with a fixedcutoff=1e-6, which dropped Hamiltonian terms withabs(dt * coeff)below about1e-3. It is now only truncated at machine precision.optimize_single_gate_update: optimized gate tensors could end up with their input legs swapped, so reading their data as a gate matrix gave the wrong gate.
1.1.0 - 2026-04-02¶
Changed¶
misc documentation improvement.
qiskit-aerswitched from test group to core dependency.kahyparswitched from core to optional dependency.cotengrustadded as optional dependency.
1.0.0 - 2026-03-18¶
Added¶
Initial public release of
qpe-toolbox.circuitmodule:quimbcircuit construction, parametrized circuits, QAOA, gate counting, serialization, and plotting.hamiltonianmodule:Hamiltonianclass, spin models,pyscfinterface for molecular chemistry, fermionic encodings viaopenfermion.estimationmodule: textbook and robust QPE variants, LCU walk operators, block encoding, QFT, Hadamard test.tensormodule: MPS/MPO utilities beyond whatquimbprovides natively.Sphinx documentation deployed to GitHub Pages.
Full test suite with ≥ 70 % branch coverage.
CI/CD workflows for testing and PyPI publishing.