Skip to content

Commit e0ef92d

Browse files
authored
Merge branch 'master' into dev
2 parents 85e9f6a + 56555b6 commit e0ef92d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+18894
-1721
lines changed

.all-contributorsrc

+25-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@
247247
"avatar_url": "https://avatars.githubusercontent.com/u/61252303?v=4",
248248
"profile": "https://www.linkedin.com/in/felix-xu-16a153196/",
249249
"contributions": [
250-
"tutorial"
250+
"tutorial",
251+
"code",
252+
"test"
251253
]
252254
},
253255
{
@@ -258,6 +260,28 @@
258260
"contributions": [
259261
"doc"
260262
]
263+
},
264+
{
265+
"login": "PeilinZHENG",
266+
"name": "peilin",
267+
"avatar_url": "https://avatars.githubusercontent.com/u/45784888?v=4",
268+
"profile": "https://github.com/PeilinZHENG",
269+
"contributions": [
270+
"tutorial",
271+
"code",
272+
"test",
273+
"doc"
274+
]
275+
},
276+
{
277+
"login": "EmilianoG-byte",
278+
"name": "Cristian Emiliano Godinez Ramirez",
279+
"avatar_url": "https://avatars.githubusercontent.com/u/57567043?v=4",
280+
"profile": "https://emilianog-byte.github.io",
281+
"contributions": [
282+
"code",
283+
"test"
284+
]
261285
}
262286
],
263287
"contributorsPerLine": 6,

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,39 @@
22

33
## Unreleased
44

5+
## 0.11.0
6+
57
### Added
68

79
- Add multiple GPU VQE examples using jax pmap
810

11+
- Add `with_prob` option to `general_kraus` so that the probability of each option can be returned together
12+
13+
- Add benchmark example showcasing new way of implementing matrix product using vmap
14+
15+
- Add keras3 example showcasing integration with tc
16+
17+
- Add circuit copy method that avoid shallow copy issue `Circuit.copy()`
18+
19+
- Add end to end infrastructures and methods for classical shadow in `shadows.py`
20+
21+
- Add classical shadow tutorial
22+
23+
- Add NN-VQE tutorial
24+
25+
### Fixed
26+
27+
- improve the `adaptive_vmap` to support internal jit and pytree output
28+
29+
- fix `pauli_gates` dtype unchange issue when set new dtype (not recommend to use this attr anymore)
30+
31+
- fix rem `apply_correction` bug when non-numpy backend is set
32+
33+
- fix tf warning for `cast` with higher version of tf
34+
### Changed
35+
36+
- The static method `BaseCircuit.copy` is renamed as `BaseCircuit.copy_nodes` (breaking changes)
37+
938
## 0.10.0
1039

1140
### Added

README.md

+55-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ TensorCircuit is built on top of modern machine learning frameworks: Jax, Tensor
3737

3838
Please begin with [Quick Start](/docs/source/quickstart.rst) in the [full documentation](https://tensorcircuit.readthedocs.io/).
3939

40-
For more information on software usage, sota algorithm implementation and engineer paradigm demonstration, please refer to 60+ [example scripts](/examples) and 30+ [tutorial notebooks](https://tensorcircuit.readthedocs.io/en/latest/#tutorials). API docstrings and test cases in [tests](/tests) are also informative.
40+
For more information on software usage, sota algorithm implementation and engineer paradigm demonstration, please refer to 70+ [example scripts](/examples) and 30+ [tutorial notebooks](https://tensorcircuit.readthedocs.io/en/latest/#tutorials). API docstrings and test cases in [tests](/tests) are also informative.
4141

4242
The following are some minimal demos.
4343

@@ -76,6 +76,43 @@ theta = tc.array_to_tensor(1.0)
7676
print(g(theta))
7777
```
7878

79+
<details>
80+
<summary> More highlight features for TensorCircuit (click for details) </summary>
81+
82+
- Sparse Hamiltonian generation and expectation evaluation:
83+
84+
```python
85+
n = 6
86+
pauli_structures = []
87+
weights = []
88+
for i in range(n):
89+
pauli_structures.append(tc.quantum.xyz2ps({"z": [i, (i + 1) % n]}, n=n))
90+
weights.append(1.0)
91+
for i in range(n):
92+
pauli_structures.append(tc.quantum.xyz2ps({"x": [i]}, n=n))
93+
weights.append(-1.0)
94+
h = tc.quantum.PauliStringSum2COO(pauli_structures, weights)
95+
print(h)
96+
# BCOO(complex64[64, 64], nse=448)
97+
c = tc.Circuit(n)
98+
c.h(range(n))
99+
energy = tc.templates.measurements.operator_expectation(c, h)
100+
# -6
101+
```
102+
103+
- Large-scale simulation with tensor network engine
104+
105+
```python
106+
# tc.set_contractor("cotengra-30-10")
107+
n=500
108+
c = tc.Circuit(n)
109+
c.h(0)
110+
c.cx(range(n-1), range(1, n))
111+
c.expectation_ps(z=[0, n-1], reuse=False)
112+
```
113+
114+
</details>
115+
79116
## Install
80117

81118
The package is written in pure Python and can be obtained via pip as:
@@ -168,6 +205,8 @@ We also have [Docker support](/docker).
168205

169206
- Reusable common circuit/measurement/problem templates and patterns.
170207

208+
- Jittable classical shadow infrastructures.
209+
171210
- SOTA quantum algorithm and model implementations.
172211

173212
- Support hybrid workflows and pipelines with CPU/GPU/QPU hardware from local/cloud/hpc resources using tf/torch/jax/cupy/numpy frameworks all at the same time.
@@ -182,12 +221,14 @@ This project is released by [Tencent Quantum Lab](https://quantum.tencent.com/)
182221

183222
### Citation
184223

185-
If this project helps in your research, please cite our software whitepaper published in Quantum:
224+
If this project helps in your research, please cite our software whitepaper to acknowledge the work put into the development of TensorCircuit.
186225

187-
[TensorCircuit: a Quantum Software Framework for the NISQ Era](https://quantum-journal.org/papers/q-2023-02-02-912/)
226+
[TensorCircuit: a Quantum Software Framework for the NISQ Era](https://quantum-journal.org/papers/q-2023-02-02-912/) (published in Quantum)
188227

189228
which is also a good introduction to the software.
190229

230+
Research works citing TensorCircuit can be highlighted in [Research and Applications section](https://github.com/tencent-quantum-lab/tensorcircuit#research-and-applications).
231+
191232
### Guidelines
192233

193234
For contribution guidelines and notes, see [CONTRIBUTING](/CONTRIBUTING.md).
@@ -232,8 +273,10 @@ TensorCircuit is open source, released under the Apache License, Version 2.0.
232273
<tr>
233274
<td align="center" valign="top" width="16.66%"><a href="https://github.com/eurethia"><img src="https://avatars.githubusercontent.com/u/84611606?v=4?s=100" width="100px;" alt="隐公观鱼"/><br /><sub><b>隐公观鱼</b></sub></a><br /><a href="https://github.com/tencent-quantum-lab/tensorcircuit/commits?author=eurethia" title="Code">💻</a> <a href="https://github.com/tencent-quantum-lab/tensorcircuit/commits?author=eurethia" title="Tests">⚠️</a></td>
234275
<td align="center" valign="top" width="16.66%"><a href="https://github.com/WiuYuan"><img src="https://avatars.githubusercontent.com/u/108848998?v=4?s=100" width="100px;" alt="WiuYuan"/><br /><sub><b>WiuYuan</b></sub></a><br /><a href="#example-WiuYuan" title="Examples">💡</a></td>
235-
<td align="center" valign="top" width="16.66%"><a href="https://www.linkedin.com/in/felix-xu-16a153196/"><img src="https://avatars.githubusercontent.com/u/61252303?v=4?s=100" width="100px;" alt="Felix Xu"/><br /><sub><b>Felix Xu</b></sub></a><br /><a href="#tutorial-FelixXu35" title="Tutorials">✅</a></td>
276+
<td align="center" valign="top" width="16.66%"><a href="https://www.linkedin.com/in/felix-xu-16a153196/"><img src="https://avatars.githubusercontent.com/u/61252303?v=4?s=100" width="100px;" alt="Felix Xu"/><br /><sub><b>Felix Xu</b></sub></a><br /><a href="#tutorial-FelixXu35" title="Tutorials">✅</a> <a href="https://github.com/tencent-quantum-lab/tensorcircuit/commits?author=FelixXu35" title="Code">💻</a> <a href="https://github.com/tencent-quantum-lab/tensorcircuit/commits?author=FelixXu35" title="Tests">⚠️</a></td>
236277
<td align="center" valign="top" width="16.66%"><a href="https://scholar.harvard.edu/hongyehu/home"><img src="https://avatars.githubusercontent.com/u/50563225?v=4?s=100" width="100px;" alt="Hong-Ye Hu"/><br /><sub><b>Hong-Ye Hu</b></sub></a><br /><a href="https://github.com/tencent-quantum-lab/tensorcircuit/commits?author=hongyehu" title="Documentation">📖</a></td>
278+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/PeilinZHENG"><img src="https://avatars.githubusercontent.com/u/45784888?v=4?s=100" width="100px;" alt="peilin"/><br /><sub><b>peilin</b></sub></a><br /><a href="#tutorial-PeilinZHENG" title="Tutorials">✅</a> <a href="https://github.com/tencent-quantum-lab/tensorcircuit/commits?author=PeilinZHENG" title="Code">💻</a> <a href="https://github.com/tencent-quantum-lab/tensorcircuit/commits?author=PeilinZHENG" title="Tests">⚠️</a> <a href="https://github.com/tencent-quantum-lab/tensorcircuit/commits?author=PeilinZHENG" title="Documentation">📖</a></td>
279+
<td align="center" valign="top" width="16.66%"><a href="https://emilianog-byte.github.io"><img src="https://avatars.githubusercontent.com/u/57567043?v=4?s=100" width="100px;" alt="Cristian Emiliano Godinez Ramirez"/><br /><sub><b>Cristian Emiliano Godinez Ramirez</b></sub></a><br /><a href="https://github.com/tencent-quantum-lab/tensorcircuit/commits?author=EmilianoG-byte" title="Code">💻</a> <a href="https://github.com/tencent-quantum-lab/tensorcircuit/commits?author=EmilianoG-byte" title="Tests">⚠️</a></td>
237280
</tr>
238281
</tbody>
239282
</table>
@@ -294,6 +337,12 @@ For the numerical simulation and hardware experiments with error mitigation on Q
294337

295338
Reference paper: https://arxiv.org/abs/2303.14877.
296339

340+
### NN-VQA
341+
342+
For the setup and simulation code of neural network encoded variational quantum eigensolver, see the [demo](/docs/source/tutorials/nnvqe.ipynb).
343+
344+
Reference paper: https://arxiv.org/abs/2308.01068.
345+
297346
### More works
298347

299348
<details>
@@ -317,6 +366,8 @@ Reference paper: https://arxiv.org/abs/2303.14877.
317366

318367
- GSQAS: Graph Self-supervised Quantum Architecture Search: https://arxiv.org/abs/2303.12381.
319368

369+
- Practical advantage of quantum machine learning in ghost imaging: https://www.nature.com/articles/s42005-023-01290-1 (published in Communications Physics).
370+
320371
</details>
321372

322373
If you want to highlight your research work here, feel free to add by opening PR.

README_cn.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ TensorCircuit 现在支持真实量子硬件连接和实验,并提供优雅的
3535

3636
请从 [完整文档](https://tensorcircuit.readthedocs.io/zh/latest/) 中的 [快速上手](/docs/source/quickstart.rst) 开始。
3737

38-
有关软件用法,算法实现和工程范式演示的更多信息和介绍,请参阅 60+ [示例脚本](/examples) 和 30+ [案例教程](https://tensorcircuit.readthedocs.io/zh/latest/#tutorials)[测试](/tests) 用例和 API docstring 也提供了丰富的使用信息。
38+
有关软件用法,算法实现和工程范式演示的更多信息和介绍,请参阅 70+ [示例脚本](/examples) 和 30+ [案例教程](https://tensorcircuit.readthedocs.io/zh/latest/#tutorials)[测试](/tests) 用例和 API docstring 也提供了丰富的使用信息。
3939

4040
以下是一些最简易的演示。
4141

@@ -127,7 +127,7 @@ pip install tensorcircuit-nightly
127127

128128
### 引用
129129

130-
如果该软件对您的研究有帮助, 请引用我们发表在 Quantum 期刊的白皮书文章:
130+
如果该软件对您的研究有帮助, 请引用我们发表在 Quantum 期刊的白皮书文章来支持我们的研发付出。
131131

132132
[TensorCircuit: a Quantum Software Framework for the NISQ Era](https://quantum-journal.org/papers/q-2023-02-02-912/).
133133

@@ -184,3 +184,9 @@ VQEX 在 MBL 相位识别上的应用见 [教程](/docs/source/tutorials/vqex_mb
184184
数值模拟和带错误消除的真实量子硬件实验验证 QAOA 优化的代码请参考 [项目](https://github.com/sherrylixuecheng/EMQAOA-DARBO)
185185

186186
参考论文: https://arxiv.org/abs/2303.14877。
187+
188+
### NN-VQA
189+
190+
关于神经网络编码的变分量子算法的实现和工作流, 见 [教程](/docs/source/tutorials/nnvqe.ipynb)
191+
192+
参考论文: https://arxiv.org/abs/2308.01068。

check_all.sh

100755100644
File mode changed.

docs/source/api/applications.rst

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
tensorcircuit.applications
22
================================================================================
33
.. toctree::
4+
applications/ai.rst
45
applications/dqas.rst
6+
applications/finance.rst
57
applications/graphdata.rst
68
applications/layers.rst
9+
applications/optimization.rst
10+
applications/physics.rst
711
applications/utils.rst
812
applications/vags.rst
913
applications/van.rst

docs/source/api/applications/ai.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tensorcircuit.applications.ai
2+
================================================================================
3+
.. toctree::
4+
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tensorcircuit.applications.finance
2+
================================================================================
3+
.. toctree::
4+
finance/portfolio.rst
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tensorcircuit.applications.finance.portfolio
2+
================================================================================
3+
.. automodule:: tensorcircuit.applications.finance.portfolio
4+
:members:
5+
:undoc-members:
6+
:show-inheritance:
7+
:inherited-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tensorcircuit.applications.optimization
2+
================================================================================
3+
.. automodule:: tensorcircuit.applications.optimization
4+
:members:
5+
:undoc-members:
6+
:show-inheritance:
7+
:inherited-members:
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
tensorcircuit.applications.physics
2+
================================================================================
3+
.. toctree::
4+
physics/baseline.rst
5+
physics/fss.rst
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tensorcircuit.applications.physics.baseline
2+
================================================================================
3+
.. automodule:: tensorcircuit.applications.physics.baseline
4+
:members:
5+
:undoc-members:
6+
:show-inheritance:
7+
:inherited-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tensorcircuit.applications.physics.fss
2+
================================================================================
3+
.. automodule:: tensorcircuit.applications.physics.fss
4+
:members:
5+
:undoc-members:
6+
:show-inheritance:
7+
:inherited-members:

docs/source/api/shadows.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tensorcircuit.shadows
2+
================================================================================
3+
.. automodule:: tensorcircuit.shadows
4+
:members:
5+
:undoc-members:
6+
:show-inheritance:
7+
:inherited-members:

docs/source/api/templates.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
tensorcircuit.templates
22
================================================================================
33
.. toctree::
4+
templates/ansatz.rst
45
templates/blocks.rst
56
templates/chems.rst
7+
templates/conversions.rst
68
templates/dataset.rst
79
templates/ensemble.rst
810
templates/graphs.rst

docs/source/api/templates/ansatz.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tensorcircuit.templates.ansatz
2+
================================================================================
3+
.. automodule:: tensorcircuit.templates.ansatz
4+
:members:
5+
:undoc-members:
6+
:show-inheritance:
7+
:inherited-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tensorcircuit.templates.conversions
2+
================================================================================
3+
.. automodule:: tensorcircuit.templates.conversions
4+
:members:
5+
:undoc-members:
6+
:show-inheritance:
7+
:inherited-members:

0 commit comments

Comments
 (0)