mirror of
https://github.com/vale981/HOPSFlow-Paper
synced 2025-03-05 09:41:40 -05:00
use builtin strobe for energy plot
This commit is contained in:
parent
4c7f146f47
commit
e5c8f0e70f
2 changed files with 9 additions and 5 deletions
|
@ -348,7 +348,7 @@ def full_report(model):
|
||||||
def plot_energy(model):
|
def plot_energy(model):
|
||||||
f, a = pu.plot_energy_overview(
|
f, a = pu.plot_energy_overview(
|
||||||
model,
|
model,
|
||||||
strobe_frequency=model.Ω,
|
strobe_data=model.strobe,
|
||||||
hybrid=True,
|
hybrid=True,
|
||||||
bath_names=["cold", "hot"],
|
bath_names=["cold", "hot"],
|
||||||
online=True,
|
online=True,
|
||||||
|
|
|
@ -229,21 +229,25 @@ def plot_with_σ(
|
||||||
bath=None,
|
bath=None,
|
||||||
strobe_frequency=None,
|
strobe_frequency=None,
|
||||||
strobe_tolerance=1e-3,
|
strobe_tolerance=1e-3,
|
||||||
|
strobe_data=None,
|
||||||
hybrid=False,
|
hybrid=False,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
err = (y.σ[bath] if bath is not None else y.σ).real
|
err = (y.σ[bath] if bath is not None else y.σ).real
|
||||||
y_final = transform(y.value[bath] if bath is not None else y.value)
|
y_final = transform(y.value[bath] if bath is not None else y.value)
|
||||||
|
|
||||||
strobe_mode = strobe_frequency is not None
|
strobe_mode = strobe_frequency is not None or strobe_data
|
||||||
strobe_indices = None
|
strobe_indices = None
|
||||||
strobe_times = None
|
strobe_times = None
|
||||||
strobe_style = dict(linestyle="none", marker="o", markersize=2) | kwargs
|
strobe_style = dict(linestyle="none", marker="o", markersize=2) | kwargs
|
||||||
|
|
||||||
if strobe_mode:
|
if strobe_mode:
|
||||||
strobe_times, strobe_indices = ut.strobe_times(
|
if strobe_data:
|
||||||
x, strobe_frequency, strobe_tolerance
|
strobe_times, strobe_indices = strobe_data
|
||||||
)
|
else:
|
||||||
|
strobe_times, strobe_indices = ut.strobe_times(
|
||||||
|
x, strobe_frequency, strobe_tolerance
|
||||||
|
)
|
||||||
|
|
||||||
line = ax.errorbar(
|
line = ax.errorbar(
|
||||||
strobe_times,
|
strobe_times,
|
||||||
|
|
Loading…
Add table
Reference in a new issue