Skip to content

Commit dd554a6

Browse files
committed
Update shadows.py and test_shadows.py
1 parent a9c4ee0 commit dd554a6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tensorcircuit/shadows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def entropy_shadow(
327327
return backend.log(backend.sum(backend.power(evs, alpha))) / (1 - alpha)
328328

329329

330-
def Renyi_entropy_2(snapshots: Tensor, sub: Optional[Sequence[int]] = None) -> Tensor:
330+
def renyi_entropy_2(snapshots: Tensor, sub: Optional[Sequence[int]] = None) -> Tensor:
331331
r"""To calculate the second order Renyi entropy of a subsystem from snapshot, please refer to Brydges, T. et al. Science 364, 260–263 (2019).
332332
This function is not jitable.
333333

tests/test_shadows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
local_snapshot_states,
99
global_shadow_state,
1010
entropy_shadow,
11-
Renyi_entropy_2,
11+
renyi_entropy_2,
1212
expection_ps_shadow,
1313
global_shadow_state1,
1414
global_shadow_state2,
@@ -111,7 +111,7 @@ def test_state(backend):
111111
#
112112
# expc = np.median(expection_ps_shadow(snapshots, pauli_strings, ps=ps, k=9))
113113
# ent = entropy_shadow(snapshots, pauli_strings, sub, alpha=2)
114-
# ent2 = Renyi_entropy_2(snapshots, sub)
114+
# ent2 = renyi_entropy_2(snapshots, sub)
115115
# print(expc, ent, ent2)
116116
#
117117
# pl_snapshots = np.asarray(snapshots).reshape(ns * repeat, nq)

0 commit comments

Comments
 (0)