tencent-quantum-lab / tensorcircuit

Tensor network based quantum software framework for the NISQ era
https://tensorcircuit.readthedocs.io
Apache License 2.0
265 stars 78 forks source link

VQE optimization using SPSA with noisyopt #215

Closed Gopal-Dahale closed 4 months ago

Gopal-Dahale commented 4 months ago

Purpose

A Python script for VQE optimization using SPSA and Compass search with noisyopt.

Details

The code is based on the vqe_shot_noise.py. It performs VQE with and without shot noise for gradient-free (SPSA and Compass) and gradient-based (Adam) optimizers and prints a table at the end as shown below:

==================================================================
>>> Benchmark
>> Exact ground state energy:  -7.29623
| Algorithm / Optimization   |   SPSA (Gradient Free) |   Compass Search (Gradient Free) |   Adam (Gradient based) |
|----------------------------|------------------------|----------------------------------|-------------------------|
| Without Shot Noise         |               -7.06672 |                         -7.20984 |                -7.28513 |
| With Shot Noise            |               -7.08398 |                         -7.10742 |                -7.27612 |

This PR closes #73.

Mentions

@refraction-ray

refraction-ray commented 4 months ago

LGTM, thanks for the contribution. Pls also leave a comment on the relevant issue so that I can formally assign the issue to you.

@all-contributors please add @Gopal-Dahale for example

allcontributors[bot] commented 4 months ago

@refraction-ray

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

I've put up a pull request to add @Gopal-Dahale! :tada: