This repository contains notebook driven machine learning experiments for predicting Quantum Metal design parameters from target qubit, resonator, coupler, and Hamiltonian quantities.
- Features
- Contributions
- Quick Start
- Structure
- Experiment Scripts
- Completed Work
- Desired Flow
This repo has tools to experiment with different Multi Layer Perceptron configurations for Quantum Metal parameter prediction when given a desired set of Hamiltonian parameters. The notebooks cover the following options.
-
Hyperparameter optimization
Compare Keras Tuner searches with predefined hyperparameters.
-
Feature scaling
Choose whether to scale all features to the range
[0, 1]or leave them unscaled. Scaling is strongly recommended because the design parameters vary widely in magnitude. Scaling values are saved so predictions can be converted back to physical values later. -
Categorical data encoding
Compare one hot encoding with linear encoding for categorical Quantum Metal parameters. Initial experimentation indicates one hot encoding performs better across the board.
Please contact Olivia Seidel at olivias@fnal.gov with questions or comments.
Contributors
- Sara Sussman from Fermilab for ideas
- Giuseppe Di Guglielmo from Fermilab for ML advice
- Firas Abouzahr from Northwestern for code testing and bug reports
Do this first. See docs/environment_setup.md for setup notes.
Create the conda environment.
./scripts/environment/create_conda_env.sh
conda activate cryo-modelling-envThen launch JupyterLab from the repository root.
jupyter-labA GPU is recommended. If you have a Fermilab services account, you can run Jupyter notebooks on the EAF.
- Navigate to the Fermilab EAF docs and sign in with your credentials.
- Follow the three Quickstart steps. When the second step opens a new link, enter your credentials again.
- Click Add New Server.
- Scroll to the bottom of the server options and choose Fermilab generic notebooks.
- Select the middle GPU option. From the menu choose the largest slot.
- Clone this repo there.
- Create the GPU environment:
conda env create -f environment-eaf-gpu.yml
conda activate cryo-modelling-env-gpuPlease feel free to contribute instructions if you use a GPU somewhere else.
Some model checkpoints and intermediate datasets are too large for GitHub. If you are not planning to rerun all notebooks, parse all data, and retrain all models, download the supplemental files from the shared Google Drive folder.
Google Drive supplemental files
The drive contains three directories. Each directory contains a zip file. Unzip each file into its matching folder in your cloned repo. These files are already in .gitignore, so you can use the notebooks without committing the large generated artifacts.
If you have access issues, please send a note to olivias@fnal.gov.
After setting up the environment and data, start with the data analysis notebook, then model training, then result inspection.
conda activate cryo-modelling-env
jupyter-labIn parameters.py, start with KERAS_TUNER=True. After the automated hyperparameter search finishes, copy the best values into parameters.py. Then rerun with KERAS_TUNER=False to inspect how the model learns over the epoch count. You can also increase the number of epochs and fine tune the selected hyperparameters.
The main folders contain scripts and notebooks that use machine learning to predict Quantum Metal design parameters from target Hamiltonian or electromagnetic values.
experiments/model_predict_cavity_claw_RouteMeander_eigenmodeexperiments/model_predict_coupler_NCap_cap_matrixexperiments/model_predict_qubit_TransmonCross_cap_matrixexperiments/model_predict_qubit_TransmonCross_Hamiltonian_params
Supporting folders
figurescontains paper figure sources, generation scripts, and checked in outputs.scriptscontains environment helpers and notebook maintenance utilities.docscontains setup notes and static reference images.environment.ymldefines the conda environment used by the helper scripts.
More detailed folder guides live in experiments/README.md, figures/README.md, scripts/README.md, and docs/README.md.
Within each experiment folder, the common notebooks follow this pattern.
ml_00_data_analysisloads the data and parses it into a model ready format.ml_01_train_kerastrains the model using an MLP.ml_03_hyperparameter_search_analysisplots the hyperparameter search results.ml_02_print_resultsloads a model and makes predictions with it.ml_10throughml_22notebooks contain surrogate and defined loss variants.validationnotebooks contain Ansys and downstream validation studies.
Each experiment directory also contains local parameters*.py configuration files plus generated CSV and plot outputs that stay next to the notebooks that produced them.
- Three main models have been trained with optimized hyperparameters from Keras Tuner.
- Each model predicts Quantum Metal parameters for parts of a transmon cross chip and resonator design.
- Encoding values were tested and optimized for categorical output parameters.
- Scaling techniques were implemented for both inputs and outputs.
- Training and validation sets were explicitly separated.
The desired flow is to stitch the three models together to predict a Quantum Metal design from a set of desired Top_Level_X Hamiltonian values. This uses the X_2.0 values simulated from the y values predicted by each individual model.
