Skip to content

Commit 423a6a4

Browse files
improve docs
1 parent 16b880c commit 423a6a4

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

docs/source/advance.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -382,15 +382,15 @@ The simulator supports common Clifford gates and operations:
382382

383383
- Single-qubit gates: H, X, Y, Z, S, SDG (S dagger)
384384
- 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`)
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``)
391391
- 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`)
392+
- Initialization state provided by Pauli string stabilizer (``tc.StabCircuit(inputs=...)``) or inverse tableau (`tc.StabCircuit(tableau_inputs=)`)
393+
- Probabilistic noise (``c.depolarizing``)
394394

395395

396396
Example: Quantum Teleportation
@@ -569,6 +569,6 @@ And a more neat approach to achieve this is as follows:
569569
570570
It is worth noting that since ``Circuit.unitary_kraus`` and ``Circuit.general_kraus`` call ``implicit_rand*`` API, the correct usage of these APIs is the same as above.
571571

572-
One may wonder why random numbers are dealt in such a complicated way, please refer to the `Jax design note <https://github.com/google/jax/blob/main/docs/design_notes/prng.md>`_ for some hints.
572+
One may wonder why random numbers are dealt in such a complicated way, please refer to the `Jax design note <https://jax.readthedocs.io/en/latest/jep/263-prng.html>`_ for some hints.
573573

574574
If vmap is also involved apart from jit, I currently find no way to maintain the backend agnosticity as TensorFlow seems to have no support of vmap over random keys (ping me on GitHub if you think you have a way to do this). I strongly recommend the users using Jax backend in the vmap+random setup.

docs/source/faq.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Both packages are created by `Shi-Xin Zhang <https://www.iop.cas.cn/rcjy/tpyjy/?
88

99
From users' perspective, TensorCircuit-NG maintains full compatibility with the TensorCircuit API, enhancing it with additional features and critical bug fixes. Only TensorCircuit-NG is kept up-to-date with the fast evolving scientific computing and machine learning ecosystem in Python.
1010

11-
TensorCircuit-NG is intended as a drop-in replacement for TensorCircuit, namely, by simply ``pip uninstall tensorcircuit`` and ``pip install tensorcircuit-ng``, your existing applications should continue to function seamlessly without requiring any modification to the codebase.
11+
TensorCircuit-NG is intended as a drop-in replacement for TensorCircuit, namely, by simply ``pip uninstall tensorcircuit`` and ``pip install tensorcircuit-ng``, your existing applications should continue to function seamlessly without requiring any modification to the codebase (``import tensorcircuit`` still works).
1212

1313

1414

@@ -35,6 +35,14 @@ But one have to carry out detailed benchmarks on the hardware choice, since the
3535
For tensor network tasks of more regular shape, such as MPS-MPO contraction, GPU can be much more favored and efficient than CPU.
3636

3737

38+
How can I use multiple GPUs?
39+
----------------------------------------------------
40+
41+
For different observables evaluation on different cards, see `example <https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/vqe_parallel_pmap.py>`_.
42+
43+
For distributed simulation of one circuit on multiple cards, see `example for expectation <https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/slicing_auto_pmap_vqa.py>`_ and `example for MPO <https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/slicing_auto_pmap_mpo.py>`_.
44+
45+
3846
When should I jit the function?
3947
----------------------------------------------------
4048

@@ -245,7 +253,7 @@ When performing measurements or sampling in TensorCircuit-NG, there are six diff
245253
{0: 2, 1: 0, 2: 2, 3: 0} # {state_integer: frequency}
246254
247255
248-
For more input parameters, see API doc :py:meth:`tensorcircuit.BaseCircuit.sample`.
256+
For more input parameters, see API doc :py:meth:`tensorcircuit.circuit.Circuit.sample`.
249257

250258

251259
How to get the entanglement entropy from the circuit output?

0 commit comments

Comments
 (0)