Skip to content

Commit d041fb4

Browse files
committed
Update doctest values to match updated Cell calculations.
1 parent f5814a7 commit d041fb4

4 files changed

Lines changed: 24 additions & 16 deletions

File tree

src/rydiqule/cell.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,8 @@ def add_single_coupling(
746746
Coherent Couplings:
747747
((5, 0, 0.5),(5, 1, 1.5)): {rabi_frequency: 2.0, detuning: 1.0, phase: 0, kvec: (0, 0, 0), label: probe, coherent_cc: 1, dipole_moment: 2.44, q: 0}
748748
Decoherent Couplings:
749-
((5, 1, 1.5),(5, 0, 0.5)): {gamma_transition: 38.11316}
749+
((5, 0, 0.5),(5, 0, 0.5)): {gamma_transit: 0.40697}
750+
((5, 1, 1.5),(5, 0, 0.5)): {gamma_transition: 38.11316, gamma_transit: 0.40697}
750751
Energy Shifts:
751752
None
752753
@@ -764,7 +765,8 @@ def add_single_coupling(
764765
Coherent Couplings:
765766
((5, 0, 0.5),(5, 1, 1.5)): {rabi_frequency: 2.0, detuning: 1.0, phase: 0, kvec: (0, 0, 0), label: probe, coherent_cc: 1, dipole_moment: 2.44, q: 0}
766767
Decoherent Couplings:
767-
((5, 1, 1.5),(5, 0, 0.5)): {gamma_transition: 38.11}
768+
((5, 0, 0.5),(5, 0, 0.5)): {gamma_transit: 0.40696}
769+
((5, 1, 1.5),(5, 0, 0.5)): {gamma_transition: 38.113, gamma_transit: 0.40696}
768770
Energy Shifts:
769771
None
770772
@@ -781,7 +783,8 @@ def add_single_coupling(
781783
Coherent Couplings:
782784
((5, 0, 0.5),(5, 1, 1.5)): {rabi_frequency: 1.177, detuning: 1.0, phase: 0, kvec: (0, 0, 0), label: probe, coherent_cc: 1, dipole_moment: 2.44, q: 0}
783785
Decoherent Couplings:
784-
((5, 1, 1.5),(5, 0, 0.5)): {gamma_transition: 38.11}
786+
((5, 0, 0.5),(5, 0, 0.5)): {gamma_transit: 0.40696}
787+
((5, 1, 1.5),(5, 0, 0.5)): {gamma_transition: 38.11, gamma_transit: 0.40696}
785788
Energy Shifts:
786789
None
787790
@@ -796,7 +799,8 @@ def add_single_coupling(
796799
Coherent Couplings:
797800
((5, 0, 0.5),(5, 1, 1.5)): {rabi_frequency: 4.3, detuning: 1.0, phase: 0, kvec: (0, 0, 0), label: probe, coherent_cc: 1, dipole_moment: 2.44, q: 0}
798801
Decoherent Couplings:
799-
((5, 1, 1.5),(5, 0, 0.5)): {gamma_transition: 38.11}
802+
((5, 0, 0.5),(5, 0, 0.5)): {gamma_transit: 0.4117}
803+
((5, 1, 1.5),(5, 0, 0.5)): {gamma_transition: 38.113, gamma_transit: 0.4117}
800804
Energy Shifts:
801805
None
802806

src/rydiqule/experiments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def get_snr(sensor: Sensor,
9090
>>> c.add_coupling(states=(g,e), rabi_frequency=np.linspace(1e-6, 1, 5), detuning=1, label="probe")
9191
>>> snr, mesh = rq.get_snr(c, 'probe_rabi_frequency')
9292
>>> print(snr)
93-
[ 0. 13947396.7 27887614.4 41813486.6
94-
55717871.1]
93+
[ 0. 13654034.1 27301261.5 40934886.9
94+
54548137.6]
9595
>>> print(mesh) # doctest: +SKIP
9696
[array([0. , 0.25 , 0.499999, 0.749999, 0.999999])]
9797

src/rydiqule/sensor_solution.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def get_solution_element(self, idx: int) -> Result:
352352
(3,)
353353
>>> rho_01_im = sols.get_solution_element(0)
354354
>>> print(rho_01_im)
355-
0.0013711656
355+
0.00131399
356356
357357
"""
358358
basis_size = np.sqrt(self.rho.shape[-1] + 1)
@@ -382,7 +382,11 @@ def coupling_coefficient_matrix(self, coupling: sensor_utils.StateSpecs) -> np.n
382382
>>> sol = rq.solve_steady_state(my_cell)
383383
>>> for e in sol.couplings.edges(data="coherent_cc"):
384384
... print(*e)
385+
(5, 0, 0.5, m_j=-0.5) (5, 0, 0.5, m_j=-0.5) None
386+
(5, 0, 0.5, m_j=-0.5) (5, 0, 0.5, m_j=0.5) None
385387
(5, 0, 0.5, m_j=-0.5) (5, 1, 0.5, m_j=-0.5) -0.816496580927726
388+
(5, 0, 0.5, m_j=0.5) (5, 0, 0.5, m_j=-0.5) None
389+
(5, 0, 0.5, m_j=0.5) (5, 0, 0.5, m_j=0.5) None
386390
(5, 0, 0.5, m_j=0.5) (5, 1, 0.5, m_j=0.5) 0.816496580927726
387391
(5, 1, 0.5, m_j=-0.5) (5, 0, 0.5, m_j=-0.5) None
388392
(5, 1, 0.5, m_j=-0.5) (5, 0, 0.5, m_j=0.5) None
@@ -495,7 +499,7 @@ def get_susceptibility(self) -> ComplexResult:
495499
(3,)
496500
>>> sus = sols.get_susceptibility()
497501
>>> print(sus)
498-
(1.9734254e-05+0.000376067j)
502+
(1.891136e-05+0.00036817j)
499503
500504
"""
501505
probe_rabi = self.probe_rabi*1e6 #rad/s
@@ -539,7 +543,7 @@ def get_OD(self) -> Result:
539543
(3,)
540544
>>> OD = sols.get_OD()
541545
>>> print(OD)
542-
0.3028422896
546+
0.2964844
543547
544548
"""
545549

@@ -577,7 +581,7 @@ def get_transmission_coef(self) -> Result:
577581
(3,)
578582
>>> t = sols.get_transmission_coef()
579583
>>> print(t)
580-
0.73871559029
584+
0.743427
581585
582586
"""
583587
OD = self.get_OD()
@@ -605,7 +609,7 @@ def get_phase_shift(self) -> Result:
605609
>>> print(sols.rho.shape)
606610
(3,)
607611
>>> print(sols.get_phase_shift())
608-
80.5295218956
612+
80.5294887
609613
610614
"""
611615
# reverse probe tuple order to get correct sign of imag

src/rydiqule/sensor_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ def convert_to_full_dm(dm: np.ndarray) -> np.ndarray:
405405
>>> c.add_coupling(states=(g, e), rabi_frequency=1, detuning=1)
406406
>>> sols = rq.solve_steady_state(c)
407407
>>> print(sols.rho)
408-
[0.001371 0.02613 0.000686]
408+
[0.001313 0.02558 0.000664]
409409
>>> print(rq.sensor_utils.convert_to_full_dm(sols.rho))
410-
[9.993144e-01 1.371165e-03 2.612972e-02 6.855828e-04]
410+
[9.993359e-01 1.31399e-03 2.55811e-02 6.64016e-04]
411411
412412
"""
413413
b, r = divmod(math.sqrt(dm.shape[-1]+1), 1.0)
@@ -461,10 +461,10 @@ def convert_dm_to_complex(dm: np.ndarray) -> np.ndarray:
461461
>>> c.add_coupling(states=(g, e), rabi_frequency=1, detuning=1)
462462
>>> sols = rq.solve_steady_state(c)
463463
>>> print(sols.rho)
464-
[0.001371 0.02613 0.000686]
464+
[0.001313 0.02558 0.000664]
465465
>>> print(rq.sensor_utils.convert_dm_to_complex(sols.rho))
466-
[[9.993144e-01+0.j 1.371166e-03+0.02613j]
467-
[1.371166e-03-0.02613j 6.855828e-04+0.j ]]
466+
[[9.993359e-01+0.j 1.31399e-03+0.025581j]
467+
[1.313990e-03-0.025581j 6.64016e-04+0.j ]]
468468
469469
"""
470470
b, r = divmod(math.sqrt(dm.shape[-1]+1), 1.0)

0 commit comments

Comments
 (0)