Skip to content

Commit c8084a4

Browse files
update readme and add doc
1 parent 11bd98a commit c8084a4

File tree

4 files changed

+83
-7
lines changed

4 files changed

+83
-7
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727

2828
TensorCircuit-NG is an open-source high-performance quantum software framework, supporting for automatic differentiation, just-in-time compiling, hardware acceleration, and vectorized parallelism, providing unified infrastructures and interfaces for quantum programming. It can compose quantum circuits, neural networks and tensor networks seamlessly with high simulation efficiency and flexibility.
2929

30-
TensorCircuit-NG is built on top of modern machine learning frameworks: Jax, TensorFlow, and PyTorch. It is specifically suitable for large-scale simulations of quantum-classical hybrid paradigm and variational quantum algorithms in ideal, noisy, approximate and analog cases. It also supports quantum hardware access and provides CPU/GPU/QPU hybrid deployment solutions.
30+
TensorCircuit-NG is built on top of modern machine learning frameworks: Jax, TensorFlow, and PyTorch. It is specifically suitable for large-scale simulations of quantum-classical hybrid paradigm and variational quantum algorithms in ideal, noisy, Clifford, approximate and analog cases. It also supports quantum hardware access and provides CPU/GPU/QPU hybrid deployment solutions.
3131

3232
TensorCircuit-NG is [fully compatible](https://tensorcircuit-ng.readthedocs.io/en/latest/faq.html#what-is-the-relation-between-tensorcircuit-and-tensorcircuit-ng) with TensorCircuit with more new features and bug fixes (support latest `numpy>2` and `qiskit>1`).
3333

3434
## Getting Started
3535

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

38-
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-ng.readthedocs.io/en/latest/#tutorials). API docstrings and test cases in [tests](/tests) are also informative.
38+
For more information on software usage, sota algorithm implementation and engineer paradigm demonstration, please refer to 80+ [example scripts](/examples) and 30+ [tutorial notebooks](https://tensorcircuit-ng.readthedocs.io/en/latest/#tutorials). API docstrings and test cases in [tests](/tests) are also informative.
3939

4040
For beginners, please refer to [quantum computing lectures with TC-NG](https://github.com/sxzgroup/qc_lecture) to learn both quantum computing basis and representative usage of TensorCircuit-NG.
4141

@@ -159,6 +159,8 @@ We also have [Docker support](/docker).
159159

160160
- GPU support, quantum device access support, hybrid deployment support
161161

162+
- HPC native, distributed simulation enabled, multiple devices/hosts support
163+
162164
- Efficiency
163165

164166
- Time: 10 to 10^6+ times acceleration compared to TensorFlow Quantum, Pennylane or Qiskit
@@ -180,6 +182,8 @@ We also have [Docker support](/docker).
180182

181183
- Support **noisy simulation** with both Monte Carlo and density matrix (tensor network powered) modes.
182184

185+
- Support **stabilizer circuit simulation** with stim backend
186+
183187
- Support **approximate simulation** with MPS-TEBD modes.
184188

185189
- Support **analog/digital hybrid simulation** (time dependent Hamiltonian evolution, **pulse** level simulation) with neural ode modes.
@@ -206,13 +210,13 @@ We also have [Docker support](/docker).
206210

207211
- Gradients can be obtained with both **automatic differenation** and parameter shift (vmap accelerated) modes.
208212

209-
- **Machine learning interface/layer/model** abstraction in both TensorFlow and PyTorch for both numerical simulation and real QPU experiments.
213+
- **Machine learning interface/layer/model** abstraction in both TensorFlow, PyTorch and Jax for both numerical simulation and real QPU experiments.
210214

211215
- Circuit sampling supports both final state sampling and perfect sampling from tensor networks.
212216

213217
- Light cone reduction support for local expectation calculation.
214218

215-
- Highly customizable tensor network contraction path finder with opteinsum interface.
219+
- Highly customizable tensor network contraction path finder with opteinsum and cotengra interface.
216220

217221
- Observables are supported in measurement, sparse matrix, dense matrix and MPO format.
218222

README_cn.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323

2424
TensorCircuit-NG 是下一代量子软件框架,完美支持自动微分、即时编译、硬件加速和向量并行化。
2525

26-
TensorCircuit-NG 建立在现代机器学习框架 Jax, TensorFlow, PyTorch 之上,支持机器学习后端无关的统一界面。 其特别适用于理想情况、含噪声情况及可控近似情况下,大规模量子经典混合范式和变分量子算法的高效模拟。
26+
TensorCircuit-NG 建立在现代机器学习框架 Jax, TensorFlow, PyTorch 之上,支持机器学习后端无关的统一界面。 其特别适用于理想情况、含噪声情况、稳定子情况及可控近似情况下,大规模量子经典混合范式和变分量子算法的高效模拟。
2727

2828
TensorCircuit-NG 现在支持真实量子硬件连接和实验,并提供优雅的 CPU/GPU/QPU 混合部署训练方案(v0.9+)。
2929

3030
## 入门
3131

3232
请从 [完整文档](https://tensorcircuit-ng.readthedocs.io/) 中的 [快速上手](/docs/source/quickstart.rst) 开始。
3333

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

3636
初学者也可以参考[量子计算教程](https://github.com/sxzgroup/qc_lecture)学习量子计算基础和 TensorCircuit-NG 的典型用法.
3737

@@ -105,6 +105,8 @@ pip install tensorcircuit-nightly
105105

106106
- GPU 支持、量子硬件支持、混合部署方案支持
107107

108+
- 高性能原生,分布式多卡多节点支持
109+
108110
- 效率
109111

110112
- 时间:与 TFQ, Pennylane, 或 Qiskit 相比,加速 10 到 10^6+ 倍

docs/source/advance.rst

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,76 @@ Quimb provides more flexible MPO construction options:
351351
h_tc = tc.quantum.quimb2qop(H)
352352
353353
354+
355+
Stabilizer Circuit Simulator
356+
-----------------------------
357+
358+
TensorCircuit-NG provides a Stabilizer Circuit simulator for efficient simulation of Clifford circuits.
359+
This simulator is particularly useful for quantum error correction, measurement induced phase transition, etc.
360+
361+
362+
.. code-block:: python
363+
364+
import tensorcircuit as tc
365+
366+
# Create a stabilizer circuit
367+
c = tc.StabilizerCircuit(2)
368+
369+
# Apply Clifford gates
370+
c.h(0)
371+
c.cnot(0, 1)
372+
373+
# Measure qubits
374+
results = c.measure(0, 1) # Returns measurement outcomes
375+
376+
# Sample multiple shots
377+
samples = c.sample(batch=1000) # Returns array of shape (1000, 2)
378+
379+
**Supported Operations**
380+
381+
The simulator supports common Clifford gates and operations:
382+
383+
- Single-qubit gates: H, X, Y, Z, S, SDG (S dagger)
384+
- Two-qubit gates: CNOT, CZ, SWAP
385+
- Measurements: projective measurements (`c.measurement` doesn't affect the state while `c.cond_measure` collpases the state)
386+
- Post-selection (`c.post_select`)
387+
- Random Clifford gates (`c.random_gate`)
388+
- Gates defined by tableau (`c.tableau_gate`)
389+
- Entanglement calculation (`c.entanglement_entropy`)
390+
- Pauli string operator expectation (`c.expectation_ps`)
391+
- Openqasm and qir transformation as usual circuits
392+
- Initialization state provided by Pauli string stabilizer (`tc.StabCircuit(inputs=...)`) or inverse tableau (`tc.StabCircuit(tableau_inputs=)`)
393+
- Probabilistic noise (`c.depolarizing`)
394+
395+
396+
Example: Quantum Teleportation
397+
398+
.. code-block:: python
399+
400+
c = tc.StabilizerCircuit(3)
401+
402+
# Prepare Bell pair between qubits 1 and 2
403+
c.h(1)
404+
c.cnot(1, 2)
405+
406+
# State to teleport on qubit 0 (must be Clifford)
407+
c.x(0)
408+
409+
# Teleportation circuit
410+
c.cnot(0, 1)
411+
c.h(0)
412+
413+
# Measure and apply corrections
414+
r0 = c.cond_measure(0)
415+
r1 = c.cond_measure(1)
416+
if r0 == 1:
417+
c.z(2)
418+
if r1 == 1:
419+
c.x(2)
420+
421+
422+
423+
354424
Fermion Gaussian State Simulator
355425
--------------------------------
356426

examples/slicing_auto_pmap_mpo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
This script illustrates how to parallelize both the contraction path
3-
finding and sliced contraction computation
3+
finding and sliced contraction computation for MPO expectation
44
"""
55

66
from functools import partial

0 commit comments

Comments
 (0)