entangle
numqi.entangle
numqi.entangle.hf_interpolate_dm(rho, alpha=None, beta=None, dm_norm=None)
interpolate the density matrix between rho
and the maximally mixed state
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho
|
ndarray
|
density matrix, |
required |
alpha
|
(float, None)
|
|
None
|
beta
|
(float, None)
|
|
None
|
dm_norm
|
(float, None)
|
norm of the density matrix. if None, then calculate it internally |
None
|
Returns:
Name | Type | Description |
---|---|---|
ret |
ndarray
|
interpolated density matrix, |
WARNING: rename to numqi.utils.hf_interpolate_dm
numqi.entangle.get_dm_numerical_range(op0, op1, num_point=100)
return the joint algebra numerical range of two Hermitian operators (projection)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
op0
|
ndarray
|
Hermitian operator, |
required |
op1
|
ndarray
|
Hermitian operator, |
required |
num_point
|
int
|
number of points to sample |
100
|
Returns:
Name | Type | Description |
---|---|---|
ret |
ndarray
|
joint algebra numerical range, |
numqi.entangle.get_negativity(rho, dim)
return the negativity of the density matrix wiki-link
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho
|
ndarray
|
density matrix, |
required |
dim
|
tuple[int]
|
dimension of the density matrix, |
required |
Returns:
Name | Type | Description |
---|---|---|
ret |
float
|
negativity of the density matrix |
numqi.entangle.check_reduction_witness(rho, dim, eps=-1e-07)
return whether the density matrix passes the reduction criterion quantiki-link
weaker than PPT
TODO, can positive linear map be parameterized
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho
|
ndarray
|
density matrix, |
required |
dim
|
tuple[int]
|
dimension of the density matrix, |
required |
eps
|
float
|
threshold for the reduction witness. if min(eig(X))>eps, then we say X is positive |
-1e-07
|
Returns:
Name | Type | Description |
---|---|---|
ret |
bool
|
whether the density matrix passes the reduction criterion |
numqi.entangle.check_swap_witness(rho, eps=-1e-07)
return whether the density matrix passes the swap witness criterion
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho
|
ndarray
|
density matrix, |
required |
eps
|
float
|
threshold for the swap witness |
-1e-07
|
Returns:
Name | Type | Description |
---|---|---|
ret |
bool
|
whether the density matrix passes the swap witness criterion |
numqi.entangle.get_density_matrix_plane(op0, op1)
return the plane spanned by two Hermitian operators
Parameters:
Name | Type | Description | Default |
---|---|---|---|
op0
|
ndarray
|
Hermitian operator, |
required |
op1
|
ndarray
|
Hermitian operator, |
required |
Returns:
Name | Type | Description |
---|---|---|
theta1 |
float
|
angle between op0 and op1 in the Gell-Mann basis |
hf0 |
function
|
function to generate the density matrix on the plane.
function signature: |
numqi.entangle.get_density_matrix_boundary(dm, dm_norm=None)
return the boundary of the density matrix
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dm
|
ndarray
|
density matrix, 2d array (support batch) |
required |
dm_norm
|
(float, NoneType)
|
norm of the density matrix. if None, then calculate it internally |
None
|
Returns:
Name | Type | Description |
---|---|---|
beta_l |
float
|
minimum value of beta |
beta_u |
float
|
maximum value of beta |
numqi.entangle.get_dm_cross_section_moment(op0, op1, order=1, quad_epsrel=1e-08, dim=None, kind='dm')
return the moment of the cross section of the density matrix or PPT boundary spanned by two Hermitian operators
Parameters:
Name | Type | Description | Default |
---|---|---|---|
op0
|
ndarray
|
traceless Hermitian operators, |
required |
op1
|
ndarray
|
traceless Hermitian operators, |
required |
order
|
int
|
order of the moment, for dimension=3/4/5, order=1 is enough. larger order might be needed for larger dimension |
1
|
quad_epsrel
|
float
|
relative tolerance for the quadrature |
1e-08
|
dim
|
None | tuple[int]
|
dimension of the density matrix, |
None
|
kind
|
str
|
'dm' for density matrix, 'ppt' for PPT boundary |
'dm'
|
Returns:
Name | Type | Description |
---|---|---|
ret |
ndarray
|
moment of the cross section of the density matrix or PPT boundary, |
numqi.entangle.is_dm_cross_section_similar(moment0, moment1, zero_eps=0.001)
return whether two moments are similar
Parameters:
Name | Type | Description | Default |
---|---|---|---|
moment0
|
ndarray
|
moment of the cross section of the density matrix, |
required |
moment1
|
ndarray
|
moment of the cross section of the density matrix, |
required |
zero_eps
|
float
|
threshold for zero |
0.001
|
Returns:
Name | Type | Description |
---|---|---|
ret |
bool
|
whether two moments are similar |
numqi.entangle.group_dm_cross_section_moment(moment, zero_eps=0.0001)
group the moments of the cross section of the density matrix
Parameters:
Name | Type | Description | Default |
---|---|---|---|
moment
|
ndarray
|
moments of the cross section of the density matrix, |
required |
zero_eps
|
float
|
threshold for zero |
0.0001
|
Returns:
Name | Type | Description |
---|---|---|
group_list |
list[list[int]]
|
list of groups of indices |