Compare commits
10 Commits
88e539929b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d0adf1038 | |||
| cb000c6067 | |||
| 9134ebcff6 | |||
| 6d16f668c8 | |||
| 91f57c28bd | |||
| bc64404158 | |||
| c5d51d8a4f | |||
| 84c966d1ab | |||
| 1d5f8b6b5f | |||
| 64d22430ea |
55
README.md
55
README.md
@@ -1,12 +1,57 @@
|
||||
# Notebooks #
|
||||
|
||||
This repository is for presenting purely supplementary material to research papers.
|
||||
These intended for the purposes of presentation only.
|
||||
This repository is for presenting supplementary material to research papers.
|
||||
|
||||
All scripts have been written by the owner of this repository.
|
||||
## Scope ##
|
||||
|
||||
- All scripts have been written by the owner of this repository for research conducted by the owner.
|
||||
- The code in this repository is _not_ intended to be part of research submissions, but rather **exclusively for presentation purposes**.
|
||||
|
||||
## Presentations ##
|
||||
|
||||
See the [docs/*.ipynb](docs) files.
|
||||
To run these, users require python v3.10.x and the jupyter module.
|
||||
To install the package requirements, call `just build` or `python3 -m pip install -r requirements.txt`.
|
||||
|
||||
| Paper/Research | Notebook |
|
||||
| :------------- | :------- |
|
||||
| _Dilations of commuting $C\_{0}$-semigroups with bounded generators and the von Neumann polynomial inequality_ | [examples_dilations.ipynb](docs/examples_dilations.ipynb) |
|
||||
|
||||
**Note:** The Git provider _Gitea_ does not have a display format for ipynb-files.
|
||||
To properly view and run the notebooks, users require python v3.10.x and the jupyter module.
|
||||
To install the package requirements, call `just build`
|
||||
or `python3 -m pip install -r requirements.txt`.#
|
||||
|
||||
## Usage ##
|
||||
|
||||
To run the presentations:
|
||||
|
||||
- Ensure you have a working copy of [**python 3.10.x**](https://www.python.org/downloads) on your system with rights to install packages.
|
||||
- Clone the repository.
|
||||
- Install the requirements. Navigate to the root of the repository and carry out:
|
||||
```bash
|
||||
python3 -m pip install --disable-pip-version-check -r requirements.txt
|
||||
# for Windows users:
|
||||
py -3 -m pip install --disable-pip-version-check -r requirements.txt
|
||||
```
|
||||
- Start the desired notebooks using the [jupyter](https://jupyter.org) UI or run
|
||||
```bash
|
||||
python3 -m jupyter notebook notebooks/xyz.ipynb
|
||||
# for Windows users:
|
||||
py -3 -m jupyter notebook notebooks/xyz.ipynb
|
||||
```
|
||||
to run the notebook `docs/xyz.ipynb`.
|
||||
|
||||
Alternatively we recommend the following:
|
||||
|
||||
- Ensure you have a working copy of [**python 3.10.x**](https://www.python.org/downloads) on your system with rights to install packages.
|
||||
- Ensure you have **bash** (for Windows users see the [Git SCM](https://gitforwindows.org))
|
||||
and the [**justfile**](https://github.com/casey/just#installation) tool
|
||||
(Windows users may wish to install [Chocolatey](https://chocolatey.org/install) beforehand).
|
||||
- Clone the repository.
|
||||
- Navigate in a bash terminal to the root of the repository and make use of the following commands:
|
||||
```bash
|
||||
# for setup:
|
||||
just build
|
||||
# to run the notebook docs/xyz.ipynb:
|
||||
just run xyz
|
||||
```
|
||||
(ensure that the extension is no included in the command!).
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -30,60 +30,39 @@
|
||||
"import sys;\n",
|
||||
"\n",
|
||||
"# NOTE: need this to force jupyter to reload imports:\n",
|
||||
"for key in list(sys.modules.keys()):\n",
|
||||
" if key.startswith('src.'):\n",
|
||||
" del sys.modules[key];\n",
|
||||
"for key in filter(lambda key: key.startswith('src.'), list(sys.modules.keys())):\n",
|
||||
" del sys.modules[key];\n",
|
||||
"\n",
|
||||
"os.chdir(os.path.dirname(_dh[0]));\n",
|
||||
"sys.path.insert(0, os.getcwd());\n",
|
||||
"\n",
|
||||
"from src.examples_dilations import *;"
|
||||
"from src.examples_dilations import *;\n",
|
||||
"np.random.seed(7098123); # for repeatability"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# User input:\n",
|
||||
"N = 4; # dimension of the Hilbert space.\n",
|
||||
"N = 6; # dimension of the Hilbert space; must be divisible by 2 for this construction.\n",
|
||||
"d = 4;\n",
|
||||
"\n",
|
||||
"# If you ensure that the failure of S_{T,K} >= 0 only occurs for K = {1,2,...,d}\n",
|
||||
"# + you want S_TK > 0 (strictly) for all K ≠ {1,2,...,d}:\n",
|
||||
"alpha = 1/math.sqrt(d - 0.5);\n",
|
||||
"\n",
|
||||
"# If you ensure that the failure of S_{T,K} >= 0 only occurs for K = {1,2,...,d}\n",
|
||||
"# alpha = 1/math.sqrt(d - 1);\n",
|
||||
"\n",
|
||||
"# Otherwise:\n",
|
||||
"# alpha = 1;"
|
||||
"# force k-th order dissipation operators to be strictly postive for k < k0\n",
|
||||
"# force k-th order dissipation operators to be non-positive for k >= k0\n",
|
||||
"# one can choose 2 <= k0 <= d\n",
|
||||
"k0 = d;"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
"The marginal semigroups T_i and their generators A_i:\n",
|
||||
"\n",
|
||||
" i spec bound of A_i A_i dissipative (<==> T_i contractive)?\n",
|
||||
"--- ------------------- -----------------------------------------\n",
|
||||
" 1 -0.465478 True\n",
|
||||
" 2 -0.465478 True\n",
|
||||
" 3 -0.465478 True\n",
|
||||
" 4 -0.465478 True\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# create the generators `A_i` of the marginal semigroups `T_i`:`\n",
|
||||
"alpha = 1/math.sqrt(k0 - 0.5);\n",
|
||||
"A = [\n",
|
||||
" generate_semigroup_generator(\n",
|
||||
" shape = [N, N],\n",
|
||||
@@ -98,7 +77,7 @@
|
||||
"for i, A_i in enumerate(A):\n",
|
||||
" omega_Re = spec_bounds((1/2)*(A_i + A_i.T.conj()));\n",
|
||||
" omega = spec_bounds(A_i);\n",
|
||||
" data.append((i+1, omega_Re, True if (omega_Re <= 0) else False));\n",
|
||||
" data.append((i+1, omega, True if (omega_Re <= 0) else False));\n",
|
||||
"\n",
|
||||
"repr = tabulate(\n",
|
||||
" tabular_data = data,\n",
|
||||
@@ -113,47 +92,18 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
"Dissipation operators:\n",
|
||||
"\n",
|
||||
" K min σ(S_{T,K}) S_{T,K} >= 0?\n",
|
||||
"------------ ---------------- ---------------\n",
|
||||
" [] 1.000000 True\n",
|
||||
" [3] 0.465478 True\n",
|
||||
" [2] 0.465478 True\n",
|
||||
" [1] 0.465478 True\n",
|
||||
" [0] 0.465478 True\n",
|
||||
" [2, 3] 0.212675 True\n",
|
||||
" [1, 3] 0.183738 True\n",
|
||||
" [1, 2] 0.217453 True\n",
|
||||
" [0, 3] 0.200206 True\n",
|
||||
" [0, 2] 0.301332 True\n",
|
||||
" [0, 1] 0.215681 True\n",
|
||||
" [1, 2, 3] 0.058427 True\n",
|
||||
" [0, 2, 3] 0.075037 True\n",
|
||||
" [0, 1, 3] 0.056030 True\n",
|
||||
" [0, 1, 2] 0.077350 True\n",
|
||||
"[0, 1, 2, 3] -0.082403 False\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# compute the dissipation operators `S_TK` for each `K ⊆ {1,2,...,d}``:\n",
|
||||
"S, beta_T = dissipation_operators(shape=[N, N], A=A);\n",
|
||||
"\n",
|
||||
"data = [];\n",
|
||||
"for K, S_TK, b in sorted(S, key=lambda x: len(x[0])):\n",
|
||||
" data.append((K, b, True if b >= -MACHINE_EPS else False))\n",
|
||||
"\n",
|
||||
"repr = tabulate(\n",
|
||||
" tabular_data = data,\n",
|
||||
" tabular_data = [\n",
|
||||
" (K, b, True if b >= -MACHINE_EPS else False)\n",
|
||||
" for K, S_TK, b in sorted(S, key=lambda x: (len(x[0]), x[0]) )\n",
|
||||
" ],\n",
|
||||
" headers = ['K', 'min σ(S_{T,K})', 'S_{T,K} >= 0?'],\n",
|
||||
" showindex = False,\n",
|
||||
" floatfmt = '.6f',\n",
|
||||
@@ -165,20 +115,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
"β_T = min_K min σ(S_{T,K}) = -0.082403\n",
|
||||
"⟹ T is not compeletely dissipative.\n",
|
||||
"⟹ (by Thm 1.1) T does not have a regular unitary dilation.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Display summary:\n",
|
||||
"print('')\n",
|
||||
|
||||
2
justfile
2
justfile
@@ -89,7 +89,7 @@ clean:
|
||||
@just clean-notebooks
|
||||
clean-notebooks:
|
||||
@echo "Clean python notebooks."
|
||||
@#{{PYTHON}} -m jupyter nbconvert --clear-output --inplace docs/*.ipynb
|
||||
@{{PYTHON}} -m jupyter nbconvert --clear-output --inplace docs/*.ipynb
|
||||
@- {{PYTHON}} -m jupytext --update-metadata '{"vscode":""}' docs/*.ipynb 2> /dev/null
|
||||
@- {{PYTHON}} -m jupytext --update-metadata '{"vscode":null}' docs/*.ipynb 2> /dev/null
|
||||
clean-basic:
|
||||
|
||||
@@ -20,3 +20,4 @@ typing-extensions==3.10.0.2 # <- need this instead of >= 4.2.0 for compatibility
|
||||
|
||||
# maths
|
||||
numpy>=1.22.4
|
||||
tabulate>=0.8.10
|
||||
|
||||
@@ -4,11 +4,8 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# AUTHOR: Raj Dahya
|
||||
# CREATED: 05.09.2022
|
||||
# EDITED: 08.10.2022
|
||||
# TYPE: Source code
|
||||
# DEPARTMENT: Fakult\"at for Mathematik und Informatik
|
||||
# INSTITUTE: Universit\"at Leipzig
|
||||
# NOTE: Collapse this block.
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -49,7 +46,7 @@ def generate_semigroup_generator(
|
||||
- `base` - <int> If `rational = True`, fixes the denominator of the rational numbers.
|
||||
- `alpha` - <float> Additional parameter to scale the D_i operators.
|
||||
|
||||
NOTE: in the paper `α = 1` was chosen. However one can choose any value in `(1/√d, \infty)`.
|
||||
NOTE: One can choose any value of `α ∈ (1/√d, \infty)`.
|
||||
By choosing any value `α ≥ 1/√(d-1)`, by the computations in Proposition 5.3
|
||||
one can force that the S_TK operators only fail to be positive when |K| > d-1.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user