View on QuantumAI | Run in Google Colab | View source on GitHub | Download notebook |
This notebook presents the experimental data which was collected on Google Rainbow processor for the Fermi-Hubbard spin-charge separation experiment.
try:
import recirq
except ImportError:
print("Installing ReCirq...")
!pip install git+https://github.com/quantumlib/recirq --quiet
print("Installed ReCirq!")
import glob
from tqdm.notebook import tqdm
from recirq.fermi_hubbard import (
InstanceBundle,
apply_rescalings_to_bundles,
find_bundles_rescalings,
load_experiment,
plot_quantity
)
from recirq.fermi_hubbard.publication import (
parasitic_cphase_compensation,
fetch_publication_data
)
# Hide numpy warnings
import warnings
warnings.filterwarnings('ignore')
Get the data
In order to run this notebook, the data sets gaussians_1u1d.zip
, trapping_2u2d.zip
and trapping_3u3d.zip
need to be downloaded and extracted from https://doi.org/10.5061/dryad.crjdfn32v. The function fetch_publication_data
is a utility to do this.
data_dir = "fermi_hubbard_data"
fetch_publication_data(base_dir=data_dir)
Downloading gaussians_1u1d_nofloquet... Successfully downloaded. Downloading gaussians_1u1d... Successfully downloaded. Downloading trapping_2u2d... Successfully downloaded. Downloading trapping_3u3d... Successfully downloaded.
Noninteracting Gaussians
# Load results and create a bundle with extracted quantities.
gaussians_1u1d_files = glob.glob(f'{data_dir}/gaussians_1u1d/0.0/*.json')
gaussians_bundle = InstanceBundle(
experiments=[load_experiment(file) for file in gaussians_1u1d_files],
steps=range(65),
rescale_steps=range(65))
# Simulate the exact numerical results that are used as a reference.
with tqdm(range(len(gaussians_bundle.steps))) as progress:
def post_run(_1, _2):
progress.update()
gaussians_bundle.cache_exact_numerics(post_run_func=post_run)
0%| | 0/65 [00:00<?, ?it/s]
plot_quantity(gaussians_bundle, 'post_selection', show_std_dev=True);
plot_quantity(gaussians_bundle, 'scaling', show_std_error=True);
# The data for this quantity can be viewed after double-clicking this cell output.
plot_quantity(gaussians_bundle, 'up_down_density', show_std_error=True);
plot_quantity(gaussians_bundle, 'up_down_position_average', show_std_error=True);
plot_quantity(gaussians_bundle, 'up_down_position_average_dt', show_std_error=True);
Trapping Potential N=4
# Load results and create a bundles with extracted quantities for each
# interaction strength.
trapping_2u2d_files = [
glob.glob(f'{data_dir}/trapping_2u2d/{u}/*.json')
for u in [0.0, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0]]
trapping_2u2d_bundles = [InstanceBundle(
experiments=[load_experiment(file) for file in files],
numerics_transform=parasitic_cphase_compensation(0.138),
steps=range(11),
rescale_steps=range(11)) for files in trapping_2u2d_files]
# Simulate the exact numerical results that are used as a reference.
total_steps = sum(len(bundle.steps) for bundle in trapping_2u2d_bundles)
with tqdm(range(total_steps)) as progress:
def post_run(_1, _2):
progress.update()
for bundle in trapping_2u2d_bundles:
bundle.cache_exact_numerics(post_run_func=post_run)
0%| | 0/110 [00:00<?, ?it/s]
# Use shared rescaling values among compatible problem instances.
apply_rescalings_to_bundles(find_bundles_rescalings(trapping_2u2d_bundles))
plot_quantity(trapping_2u2d_bundles, 'post_selection', show_std_dev=True);
plot_quantity(trapping_2u2d_bundles, 'scaling', show_std_error=True);
plot_quantity(trapping_2u2d_bundles, 'charge_spin_density', show_std_error=True);
plot_quantity(trapping_2u2d_bundles, 'charge_spin_spreading', show_std_error=True);
plot_quantity(trapping_2u2d_bundles, 'charge_spin_spreading_dt', show_std_error=True);
Trapping Potential N=6
# Load results and create a bundles with extracted quantities for each
# interaction strength.
trapping_3u3d_files = [
glob.glob(f'{data_dir}/trapping_3u3d/{u}/*.json')
for u in [0.0, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0]]
trapping_3u3d_bundles = [InstanceBundle(
experiments=[load_experiment(file) for file in files],
numerics_transform=parasitic_cphase_compensation(0.138),
steps=range(11),
rescale_steps=range(11)) for files in trapping_3u3d_files]
# Simulate the exact numerical results that are used as a reference.
total_steps = sum(len(bundle.steps) for bundle in trapping_3u3d_bundles)
with tqdm(range(total_steps)) as progress:
def post_run(_1, _2):
progress.update()
for bundle in trapping_3u3d_bundles:
bundle.cache_exact_numerics(post_run_func=post_run)
0%| | 0/110 [00:00<?, ?it/s]
# Use shared rescaling values among compatible problem instances.
apply_rescalings_to_bundles(find_bundles_rescalings(trapping_3u3d_bundles))
plot_quantity(trapping_3u3d_bundles, 'post_selection', show_std_dev=True);
plot_quantity(trapping_3u3d_bundles, 'scaling', show_std_error=True);
plot_quantity(trapping_3u3d_bundles, 'charge_spin_density', show_std_error=True);
plot_quantity(trapping_3u3d_bundles, 'charge_spin_spreading', show_std_error=True);
plot_quantity(trapping_3u3d_bundles, 'charge_spin_spreading_dt', show_std_error=True);