Skip to content

Commit

Permalink
Optimize calculations for W by impossing [W,E]=0
Browse files Browse the repository at this point in the history
  • Loading branch information
Leander Reascos committed Jan 8, 2025
1 parent b32ec53 commit 2a4fb55
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 93 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ This document provides comprehensive guidance on using SymPT, detailing its key
- [Schrieffer-Wolff Transformation (SWT)](#schrieffer-wolff-transformation-swt)
- [Full-Diagonalization (FD)](#full-diagonalization-fd)
- [Arbitrary Coupling Elimination (ACE)](#arbitrary-coupling-elimination-ace)
- [Least-Action Multi-Block Transformations](#least-action-multi-block-transformations)
7. [Advanced Tools](#advanced-tools)
8. [Contributing](#contributing)
9. [License](#license)
Expand Down
12 changes: 6 additions & 6 deletions examples/C1_Quantum_rabi_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -83,7 +83,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -221,7 +221,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Converting to operator form: 100%|███████████████| 3/3 [00:00<00:00, 226.93it/s]\n"
"Converting to operator form: 100%|██████████| 3/3 [00:00<00:00, 212.57it/s]\n"
]
},
{
Expand Down Expand Up @@ -253,7 +253,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "sympt",
"language": "python",
"name": "python3"
},
Expand All @@ -267,7 +267,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.1"
"version": "3.11.11"
}
},
"nbformat": 4,
Expand Down
16 changes: 8 additions & 8 deletions examples/C2_Quantum_rabi_TD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Computing the effective Hamiltonian: 100%|████████| 2/2 [00:00<00:00, 10.10it/s]\n",
"Computing the effective Hamiltonian: 100%|██████████| 2/2 [00:00<00:00, 10.43it/s]\n",
"\u001b[32mThe Hamiltonian has been solved successfully. Please use the get_H method to get the result in the desired form.\u001b[0m\n",
"Converting to operator form: 100%|████████████████| 2/2 [00:00<00:00, 42.23it/s]\n"
"Converting to operator form: 100%|██████████| 2/2 [00:00<00:00, 37.09it/s]\n"
]
},
{
Expand Down Expand Up @@ -191,8 +191,8 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Rotating the expression: 100%|███████████████████| 2/2 [00:00<00:00, 293.80it/s]\n",
"Converting to operator form: 100%|███████████████| 3/3 [00:00<00:00, 204.67it/s]\n"
"Rotating the expression: 100%|██████████| 2/2 [00:00<00:00, 297.06it/s]\n",
"Converting to operator form: 100%|██████████| 3/3 [00:00<00:00, 175.88it/s]\n"
]
},
{
Expand Down Expand Up @@ -249,9 +249,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Computing the effective Hamiltonian: 100%|████████| 2/2 [00:00<00:00, 9.70it/s]\n",
"Computing the effective Hamiltonian: 100%|██████████| 2/2 [00:00<00:00, 8.27it/s]\n",
"\u001b[32mThe Hamiltonian has been solved successfully. Please use the get_H method to get the result in the desired form.\u001b[0m\n",
"Converting to operator form: 100%|████████████████| 2/2 [00:00<00:00, 6.79it/s]\n"
"Converting to operator form: 100%|██████████| 2/2 [00:00<00:00, 5.81it/s]\n"
]
}
],
Expand Down Expand Up @@ -357,7 +357,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "sympt",
"language": "python",
"name": "python3"
},
Expand All @@ -371,7 +371,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.1"
"version": "3.11.11"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions examples/C3_EDSR.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Computing the effective Hamiltonian: 100%|████████| 5/5 [00:16<00:00, 3.37s/it]\n",
"Computing the effective Hamiltonian: 100%|██████████| 5/5 [00:07<00:00, 1.54s/it]\n",
"\u001b[32mThe Hamiltonian has been solved successfully. Please use the get_H method to get the result in the desired form.\u001b[0m\n",
"Converting to matrix form: 100%|██████████████████| 6/6 [00:00<00:00, 57.79it/s]\n"
"Converting to matrix form: 100%|██████████| 6/6 [00:00<00:00, 58.80it/s]\n"
]
}
],
Expand Down Expand Up @@ -352,7 +352,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "sympt",
"language": "python",
"name": "python3"
},
Expand All @@ -366,7 +366,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.1"
"version": "3.11.11"
}
},
"nbformat": 4,
Expand Down
36 changes: 18 additions & 18 deletions examples/C4_ParametricLightInteraction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -91,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -101,7 +101,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -118,7 +118,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -139,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -151,7 +151,7 @@
"2*|{g_p}|**2*(omega_p**2 + omega_+*omega_-)*(omega_+ - omega_-)*cos(omega_p*t + phi_p)**2/((-omega_p + omega_+)*(-omega_p + omega_-)*(omega_p + omega_+)*(omega_p + omega_-))"
]
},
"execution_count": 10,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -173,7 +173,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 8,
"metadata": {
"scrolled": true
},
Expand All @@ -187,7 +187,7 @@
"2*|{g_p}|**2*(omega_p**2 + omega_+*omega_-)*(omega_+ - omega_-)*cos(omega_p*t + phi_p)**2/((-omega_p + omega_+)*(-omega_p + omega_-)*(omega_p + omega_+)*(omega_p + omega_-))"
]
},
"execution_count": 11,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -213,7 +213,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -225,7 +225,7 @@
"-4*|{g_p}|**2*(-omega_p**2 + omega_+*omega_-)*(omega_+ + omega_-)*cos(omega_p*t + phi_p)**2/((-omega_p + omega_+)*(-omega_p + omega_-)*(omega_p + omega_+)*(omega_p + omega_-))"
]
},
"execution_count": 12,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -244,7 +244,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand All @@ -256,7 +256,7 @@
"-2*|{g_p}|**2*(-omega_p**2 + omega_+*omega_-)*(omega_+ + omega_-)*(cos(2*omega_p*t + 2*phi_p) + 1)/((-omega_p + omega_+)*(-omega_p + omega_-)*(omega_p + omega_+)*(omega_p + omega_-))"
]
},
"execution_count": 13,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -282,7 +282,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand All @@ -294,7 +294,7 @@
"-|{g_p}|**2*(omega_+ + omega_-)*(-omega_p**2*cos(2*omega_p*t + 2*phi_p) - omega_p**2 - I*omega_p*omega_+*sin(2*omega_p*t + 2*phi_p) + I*omega_p*omega_-*sin(2*omega_p*t + 2*phi_p) + omega_+*omega_-*cos(2*omega_p*t + 2*phi_p) + omega_+*omega_-)/((-omega_p + omega_+)*(-omega_p + omega_-)*(omega_p + omega_+)*(omega_p + omega_-))"
]
},
"execution_count": 14,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -313,7 +313,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand All @@ -325,7 +325,7 @@
"-|{g_p}|**2*(omega_+ + omega_-)*(-omega_p**2*cos(2*omega_p*t + 2*phi_p) - omega_p**2 - I*omega_p*omega_+*sin(2*omega_p*t + 2*phi_p) + I*omega_p*omega_-*sin(2*omega_p*t + 2*phi_p) + omega_+*omega_-*cos(2*omega_p*t + 2*phi_p) + omega_+*omega_-)/((-omega_p + omega_+)*(-omega_p + omega_-)*(omega_p + omega_+)*(omega_p + omega_-))"
]
},
"execution_count": 15,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -345,7 +345,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "sympt",
"language": "python",
"name": "python3"
},
Expand All @@ -359,7 +359,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.1"
"version": "3.11.11"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 2a4fb55

Please sign in to comment.