Paddle-quantum

Latest version: v2.4.0

Safety actively analyzes 714919 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

2.1.2

Release Note

New Modules

Quantum chemistry module

Add the quantum chemistry module `paddle_quantum.qchem`. This module, depending on `Psi4` and `OpenFermion`, can construct Hamiltonian applicable to quantum computers from chemical molecular structure and supports most platforms. To use the `qchem` module, please refer to the README file.

Time evolution simulation module

Add the module `paddle_quantum.trotter` for constructing circuits that simulate the time evolution of quantum systems. Arbitrarily high order Trotter-Suzuki circuits are provided as a built-in function `construct_trotter_circuit()`. Additionally, users can design custom time evolution circuits with user-specified permutation and coefficients. For more detailed usage, please refer to our tutorials on Hamiltonian simulation.

Measurement-based quantum computation module

Add the measurement-based quantum computation (MBQC) module `paddle_quantum.mbqc`. It supports the simulation of universal quantum computing with the MBQC model. Unlike the conventional quantum circuit model, MBQC has its unique way of computing and thus common circuit simulation tools cannot be directly used for the simulation of this model.

Along with this new module, we also provide some examples and tutorials. The provided examples are QAOA (Quantum Approximate Optimization Algorithm), VQSVD (Variational Quantum Singular Value Decomposition), and QKernel.

New Tutorials

Quantum chemistry

- Add the tutorial *Building Molecular Hamiltonian* under the `quantum_simulation` folder, which explains how to obtain a Hamiltonian from a molecular structure.

Classical shadow

- Add the tutorial *The Classical Shadow of Unknown Quantum States* under the `quantum_simulation` folder, which introduces the concept of classical shadow and its application.
- Add the tutorial *Estimation of Quantum State Properties Based on the Classical Shadow* under the `quantum_simulation` folder, which shows how to estimate the expectation value of an observable using classical shadow.

Hamiltonian simulation

- Add the tutorial *Hamiltonian Simulation with Product Formula* under the `quantum_simulation` folder, which shows how to perform digital quantum simulations based on Suzuki product formula.
- Add the tutorial *Simulate the Spin Dynamics on a Heisenberg Chain* under the `quantum_simulation` folder, which demonstrates how to simulate the time evolution of a one-dimensional Heisenberg chain using both the built-in Trotter-Suzuki circuit and the custom time evolution circuits in Paddle Quantum.

QNN expressibility

- Add the tutorial *Expressibility of Quantum Neural Network* under the `qun_research` folder, which introduces a method for quantitatively analyzing the expressibility of quantum neural networks and evaluates the expressibility of quantum neural network templates provided by Paddle Quantum at different depths.

Quantum compiling

- Add the tutorial *Variational Quantum Circuit Compiling* under the `qnn_research` folder, which shows a process of simulating an unknown unitary operator by optimizing a parameterized quantum circuit.

Measurement-based quantum computation

- Add the tutorial *MBQC Quick Start Guide* under the `mbqc` folder, which explains the basic concepts of MBQC.
- Add the tutorial *Measurement-based Quantum Approximate Optimization Algorithm* under the `mbqc` folder, which shows how to implement the QAOA algorithm in the MBQC mode.
- Add the tutorial *Polynomial Unconstrained Boolean Optimization Problem in MBQC* under the `mbqc` folder, which shows how to solve the max-cut problem and a specific PUBO problem using the QAOA algorithm in the MBQC mode.

In addition to these new tutorials, we update the Quick Start manual to include how to draw and display a Bloch sphere using functions `plot_state_in_bloch_sphere()` and `plot_rotation_in_bloch_sphere()` from the module `paddle_quantum.utils`. The tutorial *Variational Quantum Eigensolver* is also updated to making use of the new `paddle_quantum.qchem` module.

2.1.1

Release Note

New Features

More quantum gates

- Add controlled gates `cswap()`, `cy()`, `cz()`, `crx()`, `cyy()`, `crz()`, and `ccx()` in the `UAnsatz` class.
- Add the S dagger gate `sdg()` and the T dagger gate `tdg()` in the `UAnsatz` class

Gradient calculation

- Add the `ExpecVal` class in `paddle_quantum.expecval`, which is a PaddlePaddle Python operator for calculating the expectation value of an observable w.r.t the quantum state output by a quantum circuit. It supports the computation of the gradient w.r.t. the circuit's parameters either through the finite difference method or the parameter-shift method.
- Add the `paddle_quantum.optimizer` module for using SciPy optimizers to train a circuit, including `ConjugateGradient`, `NewtonCG`, `Powell`, `SLSQP`, and `CustomOptimizer`. The `CustomOptimizer` class is a base class for all the other optimizers.
- Add `finite_difference_gradient()`, `param_shift_gradient()`, and `linear_combinations_gradient()` in the `UAnsatz` class for computing the gradient of the expectation of an observable w.r.t. the parameters in a circuit.

Hamiltonian

Add the `Hamiltonian` class in `paddle_quantum.utils` for processing Hamiltonian. The main functions of this class are:

- Construct a Hamiltonian from a Pauli string;
- Get the matrix corresponding to the Hamiltonian;
- Get the Pauli string corresponding to the Hamiltonian;
- Addition, subtraction and scalar multiplication.

Classical shadow

- Add `shadow_sample()` in `paddle_quantum.shadow` for sampling local Pauli measurement.
- Add `shadow_trace()` in the `UAnsatz` class for estimating the expectation value of an observable through classical shadows.

Quantum finance

- Add the `paddle_quantum.finance` module for handling some finance optimization problems.

Other features

- Add `swap_test()` in `paddle_quantum.circuit` for constructing a swap test circuit.
- Add `reset_state()` in the `UAnsatz` class for resetting a partial state.
- Update `basis_encoding()`, `amplitude_encoding()`, and `angle_encoding()` to support encoding classical data to partial quantum state.
- Update `vec()` in `paddle_quantum.state` to support generating arbitrary computational basis state.
- Add `plot_state_in_bloch_sphere()` and `plot_rotation_in_bloch_sphere()` in `paddle_quantum.utils` for drawing a Bloch sphere.

New Tutorials

Gradient calculation

- Add the tutorial *Calculating Gradient Using Quantum Circuit* under the `qnn_research` folder, which explains how to calculate gradient with quantum circuits and then use PaddlePaddle's or SciPy's optimizers to train an ansatz.

Quantum finance

- Add three tutorials on *Arbitrage Opportunity Optimization*, *Portfolio Optimization*, and *Portfolio Diversification* under the `combinatorial_optimization` folder, which use the new `paddle_quantum.finance` module to solve these problems with quantum optimization algorithms.

Bug Fix

- Fix the bug of ``t()`` gate in `paddle_quantum.locc`.

2.1.0

Release Note

Tutorials

- Reorganize tutorials according to applications and research areas:
- Combinatorial Optimization
- LOCCNet
- Machine Learning
- QNN Research
- Quantum Simulation

- Add five new tutorials:
- Large-scale QAOA via Divide-and-Conquer
- Encoding Classical Data into Quantum States
- Travelling Salesman Problem
- Quantum Kernel Methods
- Variational Shadow Quantum Learning

New Features

- Add two new types of noise models: `reset` and `thermal_relaxation`.
- Add four kinds of encoding methods, such that classical data can be encoded into quantum data via encoding functions: `basis_encoding`, `amplitude_encoding`, `angle_encoding`, `iqp_encoding`. For more information about encoding, please refer to our encoding tutorial.
- Add three two-qubit parameterized gates: `rxx`, `ryy`, `rzz` and two-qubit Mølmer–Sørensen gate (the native gate on ion-trap systems).
- Add circuit drawer. The quantum circuit could be printed directly via `print(cir)`.

2.0.1

Release Note

Noise model

Paddle Quantum now supports noise model, including `amplitude_damping`, `generalized_amplitude_damping`, `phase_damping`, `bit_flip`, `phase_flip`, `bit_phase_flip`, `depolarizing`, `pauli_channel`, `customized_channel`. The noise model could efficiently simulate quantum channels by Paddle Quantum.

You can refer to [this tutorial](https://qml.baidu.com/tutorials/simulating-noisy-quantum-circuits-with-paddle-quantum.html) to learn how to use this module.

New features

- [`GHZ_state`](https://qml.baidu.com/api/paddle_quantum.state.html#paddle_quantum.state.GHZ_state): Now you can generate the GHZ-state directly with Paddle Quantum.
- [`linear_entangled_layer`](https://qml.baidu.com/api/paddle_quantum.circuit.uansatz.html#paddle_quantum.circuit.UAnsatz.linear_entangled_layer): The entangled layer consisting of Ry gates, Rz gates, and CNOT gates, which only connect to its neighbors.

2.0.0

Release Note

The main update is the adaption to PaddlePaddle 2.0 with an improved model efficiency up to 40%.

> The version of paddlepaddle should be 2.0.1+.

Since there are many changes in PaddlePaddle 2.0, we need to adapt to it. The detailed change of API can be browsed in [API mapping table](https://www.paddlepaddle.org.cn/documentation/docs/zh/guides/09_others_information/api_mapping_cn.html).

Common PaddlePaddle API Update

1. Change `paddle.fluid.Layer` to `paddle.nn.Layer`.
2. Change `paddle.fluid.dygraph.to_variable` to `paddle.to_tensor`.
3. Change `paddle.fluid.initializer.Uniform` to `paddle.nn.initializer.Uniform`.
4. Change `paddle.fluid.optimizer.AdamOptimizer` to `paddle.optimizer.Adam`.
5. `with fluid.dygraph.gurad():` can be currently removed. PaddlePaddle is run in dynamic graph mode by default.
6. After back-propagation, it is recommended to use `optimizer.clear_grad()` to clear gradients.
7. PaddlePaddle now only supports global random seed, which can be set with `paddle.seed(seed_number)`.

The change of complex module

The complex module has been optimized in PaddlePaddle 2.0. The API of the complex module also has been changed.

1. The real part: `paddle.real()`
2. The imaginary part: `paddle.imag()`
3. The conjugate of complex tensor: `paddle.conj()`

1.2.0

Release Note
- Add a new module LOCCNet. With this module, Paddle Quantum can now efficiently simulate distributed quantum information processing tasks.
- Add 6 tutorials on QML for quantum information processing.
- Add useful functions for quantum information.

Check out more details at [our website](https://qml.baidu.com)!

Page 2 of 3

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.