From 6212cc03e9ec287ea72026ff6bd06d397a7494e1 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Sat, 1 Jun 2024 09:53:39 -0500 Subject: [PATCH 1/3] add blank line --- toqito/state_props/is_separable.py | 1 + 1 file changed, 1 insertion(+) diff --git a/toqito/state_props/is_separable.py b/toqito/state_props/is_separable.py index 2f1f0bddf..c1305f6ff 100644 --- a/toqito/state_props/is_separable.py +++ b/toqito/state_props/is_separable.py @@ -35,6 +35,7 @@ def is_separable(state: np.ndarray, dim: None | int | list[int] = None, level: i We provide the input as a denisty matrix :math:`\rho`. On the other hand, a random density matrix will be an entangled state (a separable state). + >>> from toqito.rand import random_density_matrix >>> from toqito.state_props import is_separable >>> rho_separable = np.array([[1, 0, 1, 0], From cce291d2d9b256585b58534d3809686d7a7950b2 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Sat, 1 Jun 2024 10:01:46 -0500 Subject: [PATCH 2/3] doctest failure --- toqito/state_props/is_separable.py | 1 + 1 file changed, 1 insertion(+) diff --git a/toqito/state_props/is_separable.py b/toqito/state_props/is_separable.py index c1305f6ff..dba854a8a 100644 --- a/toqito/state_props/is_separable.py +++ b/toqito/state_props/is_separable.py @@ -36,6 +36,7 @@ def is_separable(state: np.ndarray, dim: None | int | list[int] = None, level: i On the other hand, a random density matrix will be an entangled state (a separable state). + >>> import numpy as np >>> from toqito.rand import random_density_matrix >>> from toqito.state_props import is_separable >>> rho_separable = np.array([[1, 0, 1, 0], From b66aa90d12aa720ac1a37d34fa5dd6163ab90f41 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Sat, 1 Jun 2024 10:24:31 -0500 Subject: [PATCH 3/3] remove randomly generated rho --- toqito/state_props/is_separable.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/toqito/state_props/is_separable.py b/toqito/state_props/is_separable.py index dba854a8a..e7b82cb82 100644 --- a/toqito/state_props/is_separable.py +++ b/toqito/state_props/is_separable.py @@ -43,10 +43,18 @@ def is_separable(state: np.ndarray, dim: None | int | list[int] = None, level: i ... [0, 1, 0, 1], ... [1, 0, 1, 0], ... [0, 1, 0, 1]]) - >>> rho_random = random_density_matrix(4) >>> is_separable(rho_separable) True - >>> is_separable(rho_random) + + >>> rho_not_separable = np.array([[ 0.13407875+0.j , -0.08263926-0.17760437j, + ... -0.0135111 -0.12352182j, 0.0368423 -0.05563985j], + ... [-0.08263926+0.17760437j, 0.53338542+0.j , + ... 0.19782968-0.04549732j, 0.11287093+0.17024249j], + ... [-0.0135111 +0.12352182j, 0.19782968+0.04549732j, + ... 0.21254612+0.j , -0.00875865+0.11144344j], + ... [ 0.0368423 +0.05563985j, 0.11287093-0.17024249j, + ... -0.00875865-0.11144344j, 0.11998971+0.j ]]) + >>> is_separable(rho_not_separable) False References