# Release Notes ## MindQuantum 0.10.0 Release Notes ### Major Features and Improvements #### Algorithm - [BETA] [`virtual_distillation`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/error_mitigation/mindquantum.algorithm.error_mitigation.virtual_distillation.html): Added error mitigation algorithm based on virtual distillation, which reduces quantum noise by creating virtual copies of quantum states and performing measurements on an entangled system. - [BETA] [`QuantumNeuron`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/nisq/mindquantum.algorithm.nisq.QuantumNeuron.html): Added quantum neuron implementation based on Repeat-Until-Success (RUS) strategy, which simulates classical neuron behavior through quantum circuits by applying non-linear function rotations. - [STABLE] [`SGAnsatz`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/nisq/mindquantum.algorithm.nisq.SGAnsatz.html): Added sequentially generated variational quantum circuit that can efficiently generate matrix product states with fixed bond dimension. The ansatz naturally adapts to one-dimensional quantum many-body problems by applying parameterized quantum circuit blocks to adjacent qubits. - [STABLE] [`SGAnsatz2D`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/nisq/mindquantum.algorithm.nisq.SGAnsatz2D.html): Added two-dimensional sequentially generated variational quantum circuit that can generate string-bond states. Supports automatic generation of traversal paths by specifying 2D grid dimensions or construction of specific types of string-bond states through custom line sets. - [STABLE] [`qjpeg`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/library/mindquantum.algorithm.library.qjpeg.html): Added quantum image compression algorithm based on quantum Fourier transform, which can compress quantum images by reducing the number of qubits while preserving key information in the frequency domain. - [STABLE] [`cnry_decompose`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/compiler/mindquantum.algorithm.compiler.cnry_decompose.html): Added decomposition for CnRY gate. - [STABLE] [`cnrz_decompose`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/compiler/mindquantum.algorithm.compiler.cnrz_decompose.html): Added decomposition for CnRZ gate. - [STABLE] [`BSB`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/qaia/mindquantum.algorithm.qaia.BSB.html): Added GPU acceleration support for Ballistic Simulated Bifurcation algorithm with the three precision options: `'cpu-float32'`, `'gpu-float16'`, `'gpu-int8'`. - [STABLE] [`DSB`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/qaia/mindquantum.algorithm.qaia.DSB.html): Added GPU acceleration support for Discrete Simulated Bifurcation algorithm with the three precision options: `'cpu-float32'`, `'gpu-float16'`, `'gpu-int8'`. - [STABLE] [`qudit_symmetric_encoding`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/library/mindquantum.algorithm.library.qudit_symmetric_encoding.html): Added qudit encoding functionality that maps d-level quantum states to qubit states through symmetric encoding, enabling efficient simulation of higher-dimensional quantum systems on standard qubit-based quantum computers. - [STABLE] [`qudit_symmetric_decoding`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/library/mindquantum.algorithm.library.qudit_symmetric_decoding.html): This feature introduces the ability to decode qubit symmetric states or matrices into qudit states or matrices, thereby enhancing the support for multi-level quantum systems. The decoding process involves transforming symmetric qubit states into corresponding qudit states, which facilitates efficient simulation of higher-dimensional quantum systems on standard qubit-based quantum computers. - [STABLE] [`qutrit_symmetric_ansatz`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/library/mindquantum.algorithm.library.qutrit_symmetric_ansatz.html): Introduced a qutrit symmetric ansatz that constructs a qubit ansatz preserving the symmetry of encoding for arbitrary qutrit gates. This feature allows for efficient simulation of higher-dimensional quantum systems on standard qubit-based quantum computers by leveraging symmetry-preserving transformations. The ansatz supports decomposition into `"zyz"` or `"u3"` basis and can optionally include a global phase. #### Measure - [STABLE] [`MeasureResult.to_json`](https://www.mindspore.cn/mindquantum/docs/en/master/core/gates/mindquantum.core.gates.MeasureResult.html#mindquantum.core.gates.MeasureResult.to_json): for measurement result serialization and storage - [STABLE] [`MeasureResult.reverse_endian`](https://www.mindspore.cn/mindquantum/docs/en/master/core/gates/mindquantum.core.gates.MeasureResult.html#mindquantum.core.gates.MeasureResult.reverse_endian): reverse bit order in measurement results, enabling flexible endianness handling for quantum state readouts #### Operator - [STABLE] [`mat_to_op`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/library/mindquantum.algorithm.library.mat_to_op.html): Added function to convert matrix to `QubitOperator`, supporting both little-endian and big-endian qubit ordering for seamless integration with different quantum computing frameworks. #### Circuit - [STABLE] Added [`Circuit.from_qcis()`](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.Circuit.html#mindquantum.core.circuit.Circuit.from_qcis) and [`Circuit.to_qcis()`](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.Circuit.html#mindquantum.core.circuit.Circuit.to_qcis) functions for QCIS format conversion - [STABLE] Added `__eq__` and `__ne__` methods for circuit comparison - [STABLE] [`Circuit.depth()`](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.Circuit.html#mindquantum.core.circuit.Circuit.depth): Added function to calculate quantum circuit depth with options to include single-qubit gates and align gates to barriers. #### Simulator - [STABLE] [`get_reduced_density_matrix`](https://www.mindspore.cn/mindquantum/docs/en/master/simulator/mindquantum.simulator.Simulator.html#mindquantum.simulator.Simulator.get_reduced_density_matrix): Added functionality to obtain the reduced density matrix of specified qubits by performing partial trace over other qubits. - [STABLE] [`get_qs_of_qubits`](https://www.mindspore.cn/mindquantum/docs/en/master/simulator/mindquantum.simulator.Simulator.html#mindquantum.simulator.Simulator.get_qs_of_qubits): Added functionality to obtain the quantum state of specified qubits. Returns state vector for pure states and density matrix for mixed states. Supports returning quantum states in ket (Dirac) notation. - [STABLE] When using "stabilizer" as simulator backend, added support for [`reset`](https://www.mindspore.cn/mindquantum/docs/en/master/simulator/mindquantum.simulator.Simulator.html#mindquantum.simulator.Simulator.reset) to reset quantum states. - [STABLE] When using "stabilizer" as simulator backend, added support for [`get_expectation`](https://www.mindspore.cn/mindquantum/docs/en/master/simulator/mindquantum.simulator.Simulator.html#mindquantum.simulator.Simulator.get_expectation) to calculate the expectation value of a given Hamiltonian in the current quantum state. #### Compiler - [STABLE] [`U3Fusion`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/compiler/mindquantum.algorithm.compiler.U3Fusion.html): Added compilation rule for fusing consecutive single-qubit gates into a single U3 gate. This rule scans the circuit and combines consecutive single-qubit gates acting on the same qubit into a single U3 gate. For standalone single-qubit gates, they are also converted to U3 form. Global phase tracking and inclusion is optional. - [STABLE] [`u3_decompose`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/compiler/mindquantum.algorithm.compiler.u3_decompose.html): Added functionality to decompose U3 gates into Z-X-Z-X-Z rotation sequences. Supports both standard decomposition (U3(θ,φ,λ) = Rz(φ)Rx(-π/2)Rz(θ)Rx(π/2)Rz(λ)) and alternative decomposition (U3(θ,φ,λ) = Rz(φ)Rx(π/2)Rz(π-θ)Rx(π/2)Rz(λ-π)). When any rotation angle is constant and equals zero, the corresponding RZ gate will be omitted. - [STABLE] [`DecomposeU3`](https://www.mindspore.cn/mindquantum/docs/en/master/algorithm/compiler/mindquantum.algorithm.compiler.DecomposeU3.html): Added compilation rule for U3 gate decomposition, breaking down U3 gates into Z-X-Z-X-Z rotation sequences. Supports both standard and alternative decomposition methods. #### IO - [STABLE] [`QCIS`](https://www.mindspore.cn/mindquantum/docs/en/master/io/mindquantum.io.QCIS.html): Added quantum circuit and QCIS format conversion class #### Utilities - [STABLE] [`random_hamiltonian`](https://www.mindspore.cn/mindquantum/docs/en/master/utils/mindquantum.utils.random_hamiltonian.html): Added random Pauli Hamiltonian generation functionality. Supports specifying the number of qubits and Pauli terms, with optional random seed for reproducibility. Generated Hamiltonians can be used for quantum algorithm testing and benchmarking. ### Breaking Changes - [IMPORTANT] The byte order of `keys` and `samples` in `MeasureResult` has been unified to little-endian. If your code uses these attributes, please carefully check and use the newly added `reverse_endian` method to adjust if needed. ### Bug Fixes - [`PR2497`](https://gitee.com/mindspore/mindquantum/pulls/2497): Fixed potential parameter name duplication in **Amplitude Encoder**. - [`PR2410`](https://gitee.com/mindspore/mindquantum/pulls/2410): Fixed `is_measure_end` error that returned `True` even without measurement operations. - [`PR2410`](https://gitee.com/mindspore/mindquantum/pulls/2410): Fixed incorrect calculation results after reversing qubit order in two-qubit gates. - [`PR2377`](https://gitee.com/mindspore/mindquantum/pulls/2377): Fixed recursive error in `DAGCircuit` when processing deep circuits, now supporting arbitrary depth circuits. - [`PR2345`](https://gitee.com/mindspore/mindquantum/pulls/2345): Fixed calculation error in `mqmatrix`'s `get_expectation_with_grad` method when processing batch Hamiltonians and added test cases. - [`PR2345`](https://gitee.com/mindspore/mindquantum/pulls/2345): Fixed error when using `reverse_qubits` with gates not added in specified order. - [`PR2345`](https://gitee.com/mindspore/mindquantum/pulls/2345): Fixed error in `FermionOperator.hermitian()` example code. - [`PR2319`](https://gitee.com/mindspore/mindquantum/pulls/2319): Fixed measurement error in Stabilizer simulator. - [`PR2319`](https://gitee.com/mindspore/mindquantum/pulls/2319): Fixed seed not properly applied in Stabilizer simulator. - [`PR2319`](https://gitee.com/mindspore/mindquantum/pulls/2319): Added verification for bit string correctness in Stabilizer simulator output. - [`PR2315`](https://gitee.com/mindspore/mindquantum/pulls/2315): Made **MQSim** and **Hamiltonian** serializable, supporting Python multiprocessing. - [`PR2309`](https://gitee.com/mindspore/mindquantum/pulls/2309): Fixed missing imaginary terms and coefficients in some **QAOA** ansatzes. - [`PR2309`](https://gitee.com/mindspore/mindquantum/pulls/2309): Fixed non-working `QAOAAnsatz` example. - [`PR2309`](https://gitee.com/mindspore/mindquantum/pulls/2309): Modified parameter names in ansatz circuits to match formulas. - [`PR2296`](https://gitee.com/mindspore/mindquantum/pulls/2296): Fixed index error in `kron_factor_4x4_to_2x2s()` return values, ensuring correctness of two-qubit gate decomposition function `kak_decompose`. - [`PR2285`](https://gitee.com/mindspore/mindquantum/pulls/2285): Removed unnecessary output during gradient computation. ### Other Updates - Optimized first-time quantum circuit execution speed for improved performance. - Improved precision of `params_zyz()` function, enhancing **ZYZ** decomposition accuracy. - Removed warning for uninstalled `mqvector_gpu`, now only prompting when used. - Removed warning for uninstalled MindSpore, now only prompting when used. - Added warning when Hamiltonian contains imaginary parts, alerting users to potential calculation anomalies. - Enhanced clarity of warning messages when MindSpore is not installed. - Changed `pip` source to Tsinghua mirror. ### Contributor Thanks to the following developers for their contributions: Arapat Ablimit, Chufan Lyu, GhostArtyom, LuoJianing, Mr1G, Waikikilick, donghufeng, dsdsdshe, xuxusheng, yuhan, zengqg, zhouyuanyang2024, 王上, 杨金元, 糖醋排骨. Welcome contributions to the project in any form!