diff --git a/.all-contributorsrc b/.all-contributorsrc index 2b6aff49..b1735deb 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -267,7 +267,10 @@ "avatar_url": "https://avatars.githubusercontent.com/u/45784888?v=4", "profile": "https://github.com/PeilinZHENG", "contributions": [ - "tutorial" + "tutorial", + "code", + "test", + "doc" ] } ], diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d5759a4..6e3a5473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ - Add circuit copy method that avoid shallow copy issue `Circuit.copy()` +- Add end to end infrastructures and methods for classical shadow in `shadows.py` + ### Fixed - improve the `adaptive_vmap` to support internal jit and pytree output diff --git a/README.md b/README.md index f48ee893..c8843fb2 100644 --- a/README.md +++ b/README.md @@ -273,7 +273,7 @@ TensorCircuit is open source, released under the Apache License, Version 2.0. WiuYuan
WiuYuan

💡 Felix Xu
Felix Xu

💻 ⚠️ Hong-Ye Hu
Hong-Ye Hu

📖 - peilin
peilin

+ peilin
peilin

💻 ⚠️ 📖 diff --git a/docs/source/api/applications.rst b/docs/source/api/applications.rst index 2ecae939..85c31126 100644 --- a/docs/source/api/applications.rst +++ b/docs/source/api/applications.rst @@ -1,9 +1,13 @@ tensorcircuit.applications ================================================================================ .. toctree:: + applications/ai.rst applications/dqas.rst + applications/finance.rst applications/graphdata.rst applications/layers.rst + applications/optimization.rst + applications/physics.rst applications/utils.rst applications/vags.rst applications/van.rst diff --git a/docs/source/api/applications/ai.rst b/docs/source/api/applications/ai.rst new file mode 100644 index 00000000..c8749e92 --- /dev/null +++ b/docs/source/api/applications/ai.rst @@ -0,0 +1,4 @@ +tensorcircuit.applications.ai +================================================================================ +.. toctree:: + \ No newline at end of file diff --git a/docs/source/api/applications/finance.rst b/docs/source/api/applications/finance.rst new file mode 100644 index 00000000..d3302b31 --- /dev/null +++ b/docs/source/api/applications/finance.rst @@ -0,0 +1,4 @@ +tensorcircuit.applications.finance +================================================================================ +.. toctree:: + finance/portfolio.rst \ No newline at end of file diff --git a/docs/source/api/applications/finance/portfolio.rst b/docs/source/api/applications/finance/portfolio.rst new file mode 100644 index 00000000..993b5754 --- /dev/null +++ b/docs/source/api/applications/finance/portfolio.rst @@ -0,0 +1,7 @@ +tensorcircuit.applications.finance.portfolio +================================================================================ +.. automodule:: tensorcircuit.applications.finance.portfolio + :members: + :undoc-members: + :show-inheritance: + :inherited-members: \ No newline at end of file diff --git a/docs/source/api/applications/optimization.rst b/docs/source/api/applications/optimization.rst new file mode 100644 index 00000000..87a0ffbb --- /dev/null +++ b/docs/source/api/applications/optimization.rst @@ -0,0 +1,7 @@ +tensorcircuit.applications.optimization +================================================================================ +.. automodule:: tensorcircuit.applications.optimization + :members: + :undoc-members: + :show-inheritance: + :inherited-members: \ No newline at end of file diff --git a/docs/source/api/applications/physics.rst b/docs/source/api/applications/physics.rst new file mode 100644 index 00000000..98d1a2ed --- /dev/null +++ b/docs/source/api/applications/physics.rst @@ -0,0 +1,5 @@ +tensorcircuit.applications.physics +================================================================================ +.. toctree:: + physics/baseline.rst + physics/fss.rst \ No newline at end of file diff --git a/docs/source/api/applications/physics/baseline.rst b/docs/source/api/applications/physics/baseline.rst new file mode 100644 index 00000000..2ac581ba --- /dev/null +++ b/docs/source/api/applications/physics/baseline.rst @@ -0,0 +1,7 @@ +tensorcircuit.applications.physics.baseline +================================================================================ +.. automodule:: tensorcircuit.applications.physics.baseline + :members: + :undoc-members: + :show-inheritance: + :inherited-members: \ No newline at end of file diff --git a/docs/source/api/applications/physics/fss.rst b/docs/source/api/applications/physics/fss.rst new file mode 100644 index 00000000..d65cd6c1 --- /dev/null +++ b/docs/source/api/applications/physics/fss.rst @@ -0,0 +1,7 @@ +tensorcircuit.applications.physics.fss +================================================================================ +.. automodule:: tensorcircuit.applications.physics.fss + :members: + :undoc-members: + :show-inheritance: + :inherited-members: \ No newline at end of file diff --git a/docs/source/api/shadows.rst b/docs/source/api/shadows.rst new file mode 100644 index 00000000..7aea082e --- /dev/null +++ b/docs/source/api/shadows.rst @@ -0,0 +1,7 @@ +tensorcircuit.shadows +================================================================================ +.. automodule:: tensorcircuit.shadows + :members: + :undoc-members: + :show-inheritance: + :inherited-members: \ No newline at end of file diff --git a/docs/source/api/templates.rst b/docs/source/api/templates.rst index 897ff36c..d76ab744 100644 --- a/docs/source/api/templates.rst +++ b/docs/source/api/templates.rst @@ -1,8 +1,10 @@ tensorcircuit.templates ================================================================================ .. toctree:: + templates/ansatz.rst templates/blocks.rst templates/chems.rst + templates/conversions.rst templates/dataset.rst templates/ensemble.rst templates/graphs.rst diff --git a/docs/source/api/templates/ansatz.rst b/docs/source/api/templates/ansatz.rst new file mode 100644 index 00000000..15f19650 --- /dev/null +++ b/docs/source/api/templates/ansatz.rst @@ -0,0 +1,7 @@ +tensorcircuit.templates.ansatz +================================================================================ +.. automodule:: tensorcircuit.templates.ansatz + :members: + :undoc-members: + :show-inheritance: + :inherited-members: \ No newline at end of file diff --git a/docs/source/api/templates/conversions.rst b/docs/source/api/templates/conversions.rst new file mode 100644 index 00000000..38cbe47f --- /dev/null +++ b/docs/source/api/templates/conversions.rst @@ -0,0 +1,7 @@ +tensorcircuit.templates.conversions +================================================================================ +.. automodule:: tensorcircuit.templates.conversions + :members: + :undoc-members: + :show-inheritance: + :inherited-members: \ No newline at end of file diff --git a/docs/source/modules.rst b/docs/source/modules.rst index 67e7425e..5f08781f 100644 --- a/docs/source/modules.rst +++ b/docs/source/modules.rst @@ -21,6 +21,7 @@ tensorcircuit ./api/noisemodel.rst ./api/quantum.rst ./api/results.rst + ./api/shadows.rst ./api/simplify.rst ./api/templates.rst ./api/torchnn.rst diff --git a/tensorcircuit/shadows.py b/tensorcircuit/shadows.py index 74f3c44d..7407d4d0 100644 --- a/tensorcircuit/shadows.py +++ b/tensorcircuit/shadows.py @@ -1,8 +1,10 @@ """ -Classical Shadows functions +Classical shadows functions """ + from typing import Any, Union, Optional, Sequence, Tuple, List from string import ascii_letters as ABC + import numpy as np from .cons import backend, dtypestr, rdtypestr