7.1 KiB
7.1 KiB
In [16]:
import os;
import sys;
# NOTE: need this to force jupyter to reload imports:
for key in list(sys.modules.keys()):
if key.startswith('src.'):
del sys.modules[key];
os.chdir(os.path.dirname(_dh[0]));
sys.path.insert(0, os.getcwd());
from src.examples_dilations import *;
np.random.seed(7098123); # for repeatabilityIn [17]:
# User input:
N = 4; # dimension of the Hilbert space.
d = 4;
# If you ensure that the failure of S_{T,K} >= 0 only occurs for K = {1,2,...,d}
# + you want S_TK > 0 (strictly) for all K ≠ {1,2,...,d}:
alpha = 1/math.sqrt(d - 0.5);
# If you ensure that the failure of S_{T,K} >= 0 only occurs for K = {1,2,...,d}
# alpha = 1/math.sqrt(d - 1);
# Otherwise:
# alpha = 1;In [18]:
# create the generators `A_i` of the marginal semigroups `T_i`:`
A = [
generate_semigroup_generator(
shape = [N, N],
rational = True,
base = 100,
alpha = alpha,
)
for _ in range(d)
];
data = [];
for i, A_i in enumerate(A):
omega_Re = spec_bounds((1/2)*(A_i + A_i.T.conj()));
omega = spec_bounds(A_i);
data.append((i+1, omega, True if (omega_Re <= 0) else False));
repr = tabulate(
tabular_data = data,
headers = ['i', 'spec bound of A_i', 'A_i dissipative (<==> T_i contractive)?'],
showindex = False,
floatfmt = '.6f',
colalign = ['center', 'center', 'center'],
tablefmt = 'simple',
);
print(f'\nThe marginal semigroups T_i and their generators A_i:\n\n{repr}');The marginal semigroups T_i and their generators A_i: i spec bound of A_i A_i dissipative (<==> T_i contractive)? --- ------------------- ----------------------------------------- 1 -1.000000 True 2 -1.000000 True 3 -1.000000 True 4 -1.000000 True
In [19]:
# compute the dissipation operators `S_TK` for each `K ⊆ {1,2,...,d}``:
S, beta_T = dissipation_operators(shape=[N, N], A=A);
repr = tabulate(
tabular_data = [
(K, b, True if b >= -MACHINE_EPS else False)
for K, S_TK, b in sorted(S, key=lambda x: len(x[0]))
],
headers = ['K', 'min σ(S_{T,K})', 'S_{T,K} >= 0?'],
showindex = False,
floatfmt = '.6f',
colalign = ['center', 'center', 'center'],
tablefmt = 'simple',
);
print(f'\nDissipation operators:\n\n{repr}');
Dissipation operators:
K min σ(S_{T,K}) S_{T,K} >= 0?
------------ ---------------- ---------------
[] 1.000000 True
[3] 0.465478 True
[2] 0.465478 True
[1] 0.465478 True
[0] 0.465478 True
[2, 3] 0.207789 True
[1, 3] 0.179513 True
[1, 2] 0.179239 True
[0, 3] 0.315586 True
[0, 2] 0.205222 True
[0, 1] 0.327619 True
[1, 2, 3] 0.049226 True
[0, 2, 3] 0.088339 True
[0, 1, 3] 0.098730 True
[0, 1, 2] 0.081731 True
[0, 1, 2, 3] -0.133914 False
In [20]:
# Display summary:
print('')
print(f'β_T = min_K min σ(S_{{T,K}}) = {beta_T:.6f}');
if beta_T == 0:
print('⟹ T is compeletely dissipative.');
print('⟹ (by Thm 1.1) T has a regular unitary dilation.');
elif beta_T > 0:
print('⟹ T is compeletely super dissipative.');
print('⟹ (by Thm 1.1) T has a regular unitary dilation.');
else:
print('⟹ T is not compeletely dissipative.');
print('⟹ (by Thm 1.1) T does not have a regular unitary dilation.');
β_T = min_K min σ(S_{T,K}) = -0.133914
⟹ T is not compeletely dissipative.
⟹ (by Thm 1.1) T does not have a regular unitary dilation.