Skip to content

Commit be7a774

Browse files
committed
Minor corrections and branch change in notebook_ci.yaml
1 parent 17c14e3 commit be7a774

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

.github/workflows/notebook_ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- qutip-version: '4'
2020
qutip-branch: 'qutip-4.7.X'
2121
- qutip-version: '5'
22-
qutip-branch: 'master'
22+
qutip-branch: 'dev.qsystem'
2323
steps:
2424
- uses: actions/checkout@v4
2525

tutorials-v5/quantum-system/JCM_Tutorial.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,16 @@ In realistic systems, both the cavity and atom experience losses:
7575

7676
These effects are modeled using Lindblad collapse operators in the master equation formalism.
7777

78+
**Note:** The use of local Lindblad collapse operators is usually valid only in the weak and strong coupling regime (when the interaction strength is similar to or large than the dissipation rates). However, in the ultra-strong coupling regimes, when the interaction approaches the (bare) cavity and/or atomic frequencies, unphysical effects like loss of energy conservation can occur, it is more appropriate to consider using the Bloch-Redfield solver. This will not be described here, however.
79+
7880
### Package Imports
7981

8082
Let's start by importing the necessary libraries:
8183

8284
```python
8385
import matplotlib.pyplot as plt
8486
import numpy as np
87+
from qutip.visualization import plot_energy_levels
8588
from qutip import (
8689
about,
8790
basis,
@@ -100,8 +103,11 @@ from qutip import (
100103

101104
### Why Build a Quantum System Library?
102105

103-
When working with quantum systems in QuTiP, researchers often find themselves writing repetitive code to construct Hamiltonians and operators. Consider the conventional approach to building a Jaynes-Cummings model,
104-
refer to the conventional construction [here](https://nbviewer.org/urls/qutip.org/qutip-tutorials/tutorials-v5/lectures/Lecture-1-Jaynes-Cumming-model.ipynb).
106+
When working with quantum systems in QuTiP, researchers frequently encounter the same challenge: writing repetitive boilerplate code to construct Hamiltonians and operators for well-known models. The conventional approach to building a Jaynes-Cummings system involves manually creating tensor products, carefully ordering operators, and handling dissipation - a process that's both time-consuming and error-prone.
107+
108+
To illustrate this complexity, you can examine the traditional QuTiP construction approach in this [detailed tutorial](https://nbviewer.org/urls/qutip.org/qutip-tutorials/tutorials-v5/lectures/Lecture-1-Jaynes-Cumming-model.ipynb), which demonstrates the many steps required for a complete implementation.
109+
110+
This repetitive workflow motivated us to develop a more efficient solution through standardized factory functions.
105111

106112

107113
### Solution: Factory Functions
@@ -122,7 +128,7 @@ Let's explore how quantum system library simplifies working with the Jaynes-Cumm
122128
### Example 1: Basic Resonant System
123129

124130

125-
The first example demonstrates the simplest case of the Jaynes-Cummings model: a resonant system where the cavity frequency and atomic transition frequency are identical ($\omega_c = \omega_a = 1.0$). This resonance condition maximizes the coupling efficiency between the atom and cavity field. We choose a moderate coupling strength ($g = 0.1$) relative to the frequencies, placing us in the weak-to-intermediate coupling regime. The cavity Fock space is truncated at 5 photon states, which is sufficient for most dynamics when starting from low-energy initial states. Notice how the `jaynes_cummings` function creates the entire system with a single line, no need to manually construct tensor products or worry about operator ordering.
131+
The first example demonstrates the simplest case of the Jaynes-Cummings model: a resonant system where the cavity frequency and atomic transition frequency are identical ($\omega_c = \omega_a = 1.0$). This resonance condition maximizes the coupling efficiency between the atom and cavity field. We choose a moderate coupling strength ($g = 0.1$) relative to the frequencies, placing us in the intermediate coupling regime. The cavity Fock space is truncated at 5 photon states, which is sufficient for most dynamics when starting from low-energy initial states. Notice how the `jaynes_cummings` function creates the entire system with a single line, no need to manually construct tensor products or worry about operator ordering.
126132

127133
```python
128134
# Example 1: Basic resonant system
@@ -201,6 +207,14 @@ print(f"First few eigenvalues: {eigenvals[:5]}")
201207
print(f"Ground state energy: {eigenvals[0]:.3f}")
202208
print(f"First excited energy: {eigenvals[1]:.3f}")
203209
print(f"Energy gap: {eigenvals[1] - eigenvals[0]:.3f}")
210+
211+
# Visualize energy levels
212+
fig, ax = plt.subplots(figsize=(8, 6))
213+
plot_energy_levels([jc_small.hamiltonian], ax=ax)
214+
plt.title('Jaynes-Cummings Energy Spectrum')
215+
plt.xlabel('Energy Level Index')
216+
plt.ylabel('Energy')
217+
plt.show()
204218
```
205219

206220
## Quantum Dynamics: Rabi Oscillations
@@ -214,7 +228,7 @@ The Rabi frequency depends on:
214228
- The number of photons in the cavity
215229
- The detuning between atom and cavity
216230

217-
For an initially excited atom and empty cavity, the Rabi frequency is simply $g$.
231+
For an initially excited atom and empty cavity on resonance, the Rabi frequency is simply $g$.
218232

219233
### Integration with QuTiP Solvers
220234

@@ -477,7 +491,7 @@ plt.show()
477491
The thermal analysis demonstrates that increasing temperature leads to higher steady-state cavity occupation, with the system reaching thermal equilibrium with its environment. At high thermal photon numbers ($n_{th} = 1.0$), the steady-state cavity population approaches the thermal value, while atomic excitation remains finite due to thermal activation.
478492

479493

480-
## Vacuum Rabi Splitting
494+
## Rabi Splitting
481495

482496
One of the most important phenomena in cavity QED is vacuum Rabi splitting, the splitting of energy levels due to strong coupling between atom and cavity, even when no photons are present. To observe this phenomenon clearly, we use spectroscopic techniques to examine the power spectrum of cavity emission. We set the system parameters in appropriate units with $\omega_c = \omega_a = 2\pi$ (natural frequency units), moderate coupling $g = 0.05 \times 2\pi$, and include realistic dissipation rates to model experimental conditions. We also add thermal photons ($n_{th} = 0.25$) to simulate finite temperature effects that are always present in real experiments.
483497

@@ -497,7 +511,7 @@ jc = quantum_systems.jaynes_cummings(
497511
)
498512

499513
# Compute Correlation Function and Spectrum
500-
tlist = np.linspace(0, 100, 5000)
514+
tlist = np.linspace(0, 1000, 5000)
501515
corr = correlation_2op_1t(
502516
jc.hamiltonian, None, tlist, jc.c_ops, jc.operators["a_dag"], jc.operators["a"]
503517
)
@@ -510,22 +524,22 @@ spec2 = spectrum(
510524

511525
# Plot Power Spectrum
512526
plt.figure(figsize=(8, 4))
513-
plt.plot(wlist1 / (2 * np.pi), spec1, "b", lw=2, label="eseries method")
514-
plt.plot(wlist2 / (2 * np.pi), spec2, "r--", lw=2, label="me+fft method")
527+
plt.plot(wlist1 / (2 * np.pi), spec1, "b", lw=2, label="me+fft method")
528+
plt.plot(wlist2 / (2 * np.pi), spec2, "r--", lw=2, label="eseries method")
515529
plt.xlabel("Frequency (meV)")
516530
plt.ylabel("Power Spectrum (arb. units)")
517-
plt.title("Vacuum Rabi Splitting")
531+
plt.title("Rabi Splitting")
518532
plt.legend()
519-
plt.xlim(0, 2)
533+
plt.xlim(0.75, 1.25)
520534
plt.show()
521535
```
522536

523-
The power spectrum clearly reveals the characteristic double-peak structure of vacuum Rabi splitting, with the two peaks separated by approximately $2g = 0.1 \times 2\pi \approx 0.628$ frequency units. This splitting occurs even at the quantum vacuum level, demonstrating the fundamental quantum nature of light-matter interactions in cavity QED systems.
537+
The power spectrum clearly reveals the characteristic double-peak structure of Rabi splitting, with the two peaks separated by approximately $2g = 0.1 \times 2\pi \approx 0.628$ frequency units. This splitting occurs even at the quantum vacuum level, demonstrating the fundamental quantum nature of light-matter interactions in cavity QED systems.
524538

525539

526540
## Conclusion
527541

528-
This tutorial has demonstrated the power and versatility of the Jaynes-Cummings model as a foundation for understanding cavity quantum electrodynamics. The quantum system library provides a streamlined approach to exploring this rich physics, from basic Rabi oscillations to advanced phenomena like vacuum Rabi splitting. We've seen how detuning modifies energy exchange efficiency, how dissipation fundamentally alters system dynamics, and how thermal effects establish realistic steady states. The library's integration with QuTiP solvers enables rapid exploration of parameter spaces while maintaining theoretical rigor. These tools and insights form the basis for understanding more complex quantum optical systems and advancing quantum technologies in areas ranging from quantum computing to precision sensing.
542+
This tutorial has demonstrated the power and versatility of the Jaynes-Cummings model as a foundation for understanding cavity quantum electrodynamics. The quantum system library provides a streamlined approach to exploring this rich physics, from basic Rabi oscillations to advanced phenomena like Rabi splitting. We've seen how detuning modifies energy exchange efficiency, how dissipation fundamentally alters system dynamics, and how thermal effects establish realistic steady states. The library's integration with QuTiP solvers enables rapid exploration of parameter spaces while maintaining theoretical rigor. These tools and insights form the basis for understanding more complex quantum optical systems and advancing quantum technologies in areas ranging from quantum computing to precision sensing.
529543

530544
```python
531545
about()

0 commit comments

Comments
 (0)