diff --git a/.buildinfo b/.buildinfo index 5d96e112..89d19f04 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 55f1805b28fd84590ae1799408b974b3 +config: ca994d7d76a3b179a85e8b02c96bfa72 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/_modules/index.html b/_modules/index.html deleted file mode 100644 index e0a62f76..00000000 --- a/_modules/index.html +++ /dev/null @@ -1,243 +0,0 @@ - - -
- - - -
-import urllib.parse
-import webbrowser
-import getpass
-import os
-from huggingface_hub import HfApi, HfFolder
-from squadds.core.globals import ENV_FILE_PATH
-
-
-[docs]
-def set_huggingface_api_key():
- """
- Sets the Hugging Face API key by appending it to the .env file.
- If the API key already exists in the .env file, it does not add it again.
- If the Hugging Face token is not found, it raises a ValueError.
- """
- # Check if API key already exists
- if os.path.exists(ENV_FILE_PATH):
- with open(ENV_FILE_PATH, 'r') as file:
- existing_keys = file.read()
- if 'HUGGINGFACE_API_KEY=' in existing_keys:
- print('API key already exists in .env file.')
- return
-
- # Ask for the new API key
- api_key = getpass.getpass("Enter your Hugging Face API key: ")
- # Append the new API key to the .env file
- with open(ENV_FILE_PATH, 'a') as file:
- file.write(f'\nHUGGINGFACE_API_KEY={api_key}\n')
- print('API key added to .env file.')
-
- api = HfApi()
- token = HfFolder.get_token()
- if token is None:
- raise ValueError("Hugging Face token not found. Please log in using `huggingface-cli login`.")
-
-
-
-
-[docs]
-def create_mailto_link(recipients, subject, body):
- """
- Create a mailto link with the given recipients, subject, and body.
-
- Args:
- recipients (list): A list of email addresses of the recipients.
- subject (str): The subject of the email.
- body (str): The body of the email.
-
- Returns:
- str: The generated mailto link.
-
- """
- # Encode the subject and body using urllib.parse.quote_plus to handle special characters
- subject_encoded = urllib.parse.quote_plus(subject)
- body_encoded = urllib.parse.quote_plus(body)
-
- # Construct the mailto link with the encoded subject and body
- mailto_link = f"mailto:{','.join(recipients)}?subject={subject_encoded}&body={body_encoded}"
-
- # Replace '+' with '%20' for proper space encoding
- mailto_link = mailto_link.replace('+', '%20')
- return mailto_link
-
-
-
-
-[docs]
-def send_email_via_client(dataset_name, institute, pi_name, date, dataset_link):
- """
- Sends an email notification to recipients with the details of the created dataset.
-
- Args:
- dataset_name (str): The name of the dataset.
- institute (str): The name of the institute where the dataset was created.
- pi_name (str): The name of the principal investigator who created the dataset.
- date (str): The date when the dataset was created.
- dataset_link (str): The link to the created dataset.
-
- Returns:
- None
- """
- recipients = ["shanto@usc.edu", "elevenso@usc.edu"]
- subject = f"SQuADDS: Dataset Created - {dataset_name} ({date})"
- body = f"{dataset_name} has been created by {pi_name} at {institute} on {date}.\nHere is the link - {dataset_link}"
-
- mailto_link = create_mailto_link(recipients, subject, body)
- webbrowser.open(mailto_link)
-
-
- |
|
-
|
- - |
Q: Placeholder?
-A: Placeholder.
diff --git a/modules.html b/modules.html index 3351bd0b..8a4de249 100644 --- a/modules.html +++ b/modules.html @@ -151,9 +151,9 @@- s | ||
- |
- squadds | - |
- |
- squadds.core | - |
- |
- squadds.core.globals | - |
- |
- squadds.core.utils | - |
Create a mailto link with the given recipients, subject, and body.
-recipients (list) – A list of email addresses of the recipients.
subject (str) – The subject of the email.
body (str) – The body of the email.
The generated mailto link.
-str
-Sends an email notification to recipients with the details of the created dataset.
-dataset_name (str) – The name of the dataset.
institute (str) – The name of the institute where the dataset was created.
pi_name (str) – The name of the principal investigator who created the dataset.
date (str) – The date when the dataset was created.
dataset_link (str) – The link to the created dataset.
None
-Sets the Hugging Face API key by appending it to the .env file. -If the API key already exists in the .env file, it does not add it again. -If the Hugging Face token is not found, it raises a ValueError.
-[183]:
+[249]:
db.select_system("qubit")
@@ -769,7 +769,7 @@ Querying for the a target qubit design
-[184]:
+[250]:
db.select_qubit("TransmonCross")
@@ -777,7 +777,7 @@ Querying for the a target qubit design
-[173]:
+[251]:
db.selected_system
@@ -785,7 +785,7 @@ Querying for the a target qubit design
-[173]:
+[251]:
@@ -794,7 +794,7 @@ Querying for the a target qubit design
-[204]:
+[252]:
df = db.selected_system_df()
@@ -803,7 +803,7 @@ Querying for the a target qubit design
-[204]:
+[252]:
@@ -1070,63 +1070,79 @@ Querying for the a target qubit design
+[ ]:
+
+
+
+
+
+
Querying for a target cavity design¶
-[206]:
+[309]:
-db.select_system("cavity_claw")
+db.unselect_all()
-[212]:
+[310]:
-db.select_cavity_claw("RouteMeander")
+db.select_system("cavity_claw")
-[219]:
+[311]:
-db.select_coupler("CLT")
+db.select_cavity_claw("RouteMeander")
-[ ]:
+[312]:
-
+db.select_coupler("CLT")
-
-
-Querying for a target qubit-cavity design¶
-
-[154]:
+
+[313]:
-db.select_system(["qubit","cavity_claw"])
+db.show_selections()
+
+
+
+
+
+Selected component: cavity_claw
+Selected component name: RouteMeander
+Selected data type: eigenmode
+Selected system: cavity_claw
+Selected coupler: CLT
+
+
-[209]:
+[294]:
-df = db.selected_system_df()
-df
+db.selected_system_df()
-[209]:
+[294]:
@@ -1345,6 +1361,54 @@ Querying for a target qubit-cavity design
+[ ]:
+
+
+
+
+
+
+
+
+Querying for a target qubit-cavity design¶
+
+[314]:
+
+
+db.select_system(["qubit","cavity_claw"])
+
+
+
+
+[315]:
+
+
+db.select_qubit("TransmonCross")
+db.select_cavity_claw("RouteMeander")
+db.select_coupler("CLT")
+
+
+
+
+[316]:
+
+
+db.show_selections()
+
+
+
+
+
+
+
+
+Selected qubit: TransmonCross
+Selected cavity: RouteMeander
+Selected coupler: CLT
+Selected system: ['qubit', 'cavity_claw']
+
+
Simulating the “best-guess” design¶
diff --git a/tutorials/Tutorial-1_getting_started_with_SQuADDS.ipynb b/tutorials/Tutorial-1_getting_started_with_SQuADDS.ipynb
index f2de987e..cf5a50aa 100644
--- a/tutorials/Tutorial-1_getting_started_with_SQuADDS.ipynb
+++ b/tutorials/Tutorial-1_getting_started_with_SQuADDS.ipynb
@@ -766,7 +766,7 @@
},
{
"cell_type": "code",
- "execution_count": 183,
+ "execution_count": 249,
"metadata": {},
"outputs": [],
"source": [
@@ -775,7 +775,7 @@
},
{
"cell_type": "code",
- "execution_count": 184,
+ "execution_count": 250,
"metadata": {},
"outputs": [],
"source": [
@@ -784,7 +784,7 @@
},
{
"cell_type": "code",
- "execution_count": 173,
+ "execution_count": 251,
"metadata": {},
"outputs": [
{
@@ -793,7 +793,7 @@
"'qubit'"
]
},
- "execution_count": 173,
+ "execution_count": 251,
"metadata": {},
"output_type": "execute_result"
}
@@ -804,7 +804,7 @@
},
{
"cell_type": "code",
- "execution_count": 204,
+ "execution_count": 252,
"metadata": {},
"outputs": [
{
@@ -1155,7 +1155,7 @@
"[1934 rows x 17 columns]"
]
},
- "execution_count": 204,
+ "execution_count": 252,
"metadata": {},
"output_type": "execute_result"
}
@@ -1165,6 +1165,13 @@
"df"
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -1174,57 +1181,64 @@
},
{
"cell_type": "code",
- "execution_count": 206,
+ "execution_count": 309,
"metadata": {},
"outputs": [],
"source": [
- "db.select_system(\"cavity_claw\")"
+ "db.unselect_all()"
]
},
{
"cell_type": "code",
- "execution_count": 212,
+ "execution_count": 310,
"metadata": {},
"outputs": [],
"source": [
- "db.select_cavity_claw(\"RouteMeander\")"
+ "db.select_system(\"cavity_claw\")"
]
},
{
"cell_type": "code",
- "execution_count": 219,
+ "execution_count": 311,
"metadata": {},
"outputs": [],
"source": [
- "db.select_coupler(\"CLT\")"
+ "db.select_cavity_claw(\"RouteMeander\")"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 312,
"metadata": {},
"outputs": [],
- "source": []
- },
- {
- "cell_type": "markdown",
- "metadata": {},
"source": [
- "### Querying for a target qubit-cavity design"
+ "db.select_coupler(\"CLT\")"
]
},
{
"cell_type": "code",
- "execution_count": 154,
+ "execution_count": 313,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Selected component: cavity_claw\n",
+ "Selected component name: RouteMeander\n",
+ "Selected data type: eigenmode\n",
+ "Selected system: cavity_claw\n",
+ "Selected coupler: CLT\n"
+ ]
+ }
+ ],
"source": [
- "db.select_system([\"qubit\",\"cavity_claw\"])"
+ "db.show_selections()"
]
},
{
"cell_type": "code",
- "execution_count": 209,
+ "execution_count": 294,
"metadata": {},
"outputs": [
{
@@ -1501,14 +1515,67 @@
"[234 rows x 13 columns]"
]
},
- "execution_count": 209,
+ "execution_count": 294,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "df = db.selected_system_df()\n",
- "df"
+ "db.selected_system_df()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Querying for a target qubit-cavity design"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 314,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "db.select_system([\"qubit\",\"cavity_claw\"])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 315,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "db.select_qubit(\"TransmonCross\")\n",
+ "db.select_cavity_claw(\"RouteMeander\")\n",
+ "db.select_coupler(\"CLT\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 316,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Selected qubit: TransmonCross\n",
+ "Selected cavity: RouteMeander\n",
+ "Selected coupler: CLT\n",
+ "Selected system: ['qubit', 'cavity_claw']\n"
+ ]
+ }
+ ],
+ "source": [
+ "db.show_selections()"
]
},
{
diff --git a/tutorials/Tutorial-2_Contributing_to_SQuADDS.html b/tutorials/Tutorial-2_Contributing_to_SQuADDS.html
index 8ce0afe0..8b00d51f 100644
--- a/tutorials/Tutorial-2_Contributing_to_SQuADDS.html
+++ b/tutorials/Tutorial-2_Contributing_to_SQuADDS.html
@@ -232,19 +232,12 @@ Understanding the terminology and database structureStructure of SQuADDS_DB
Adding to SQuADDS_DB
-
-[ ]:
-
-
-
-
-
-
Where we left of in Tutorial 1 - Contributing to an existing configuration¶
+Format the result from Tutorial 1 to be compatible with SQuADDS.
-[ ]:
+[2]:
@@ -271,6 +264,21 @@ How to contribute to an existing configuration:
+
Show how to add this new data entry to the SQuADDS database by creating a PR.
+
+Code to fork the repo and create a new branch.
+Code to add the new data to the chosen configuration.
+Code to commit and push the changes.
+Code to create a PR.
+
+
+[ ]:
+
+
+
+
+
+
@@ -306,6 +314,21 @@ Data Processing:sim_results has the same units you can just use a "units":units
field instead of repeating the unit for each result.
+
+
+Metadata:¶
+The metadata for the configuration should include
+
+the name of the configuration
+a description of the configuration
+contributors to the configuration
+device design, design tool and name
+simulation setup and simulator name
+simulation code Simulator
+simulation result parameters
+measured parameters
+
+Code to help generate portions of the metadata and guide the user to create custom Simulator
(future release and tutorial)
[ ]:
@@ -343,6 +366,14 @@ How to contribute a new configuration:
+Code to fork the repo and create a new branch.
+Code to add the new data to a new configuration.
+Code to add metadata to the configuration.
+Code to commit and push the changes.
+Code to create a PR.
+
[ ]:
@@ -356,6 +387,16 @@ How to contribute a new configuration:
Building on top of others works¶
We might have some data that can be appended to an existing dataset in SQuADDS. In this case, we can add to the existing configuration in SQuADDS_DB
without pushing new entries to the original dataset.
+
+Code to fork the repo and create a new branch.
+Code to add the new data to the chosen configuration.
+
+handling contributions (appending code gives uploader name and institute only and notes)
+
+
+Code to commit and push the changes.
+Code to create a PR.
+
[ ]:
@@ -436,6 +477,7 @@ License¶
- Contributing a New Configuration
diff --git a/tutorials/Tutorial-2_Contributing_to_SQuADDS.ipynb b/tutorials/Tutorial-2_Contributing_to_SQuADDS.ipynb
index f80d123b..c21e8098 100644
--- a/tutorials/Tutorial-2_Contributing_to_SQuADDS.ipynb
+++ b/tutorials/Tutorial-2_Contributing_to_SQuADDS.ipynb
@@ -115,23 +115,18 @@
"- Adding to SQuADDS_DB"
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Where we left of in Tutorial 1 - *Contributing to an existing configuration* "
+ "## Where we left of in Tutorial 1 - *Contributing to an existing configuration* \n",
+ "\n",
+ "Format the result from Tutorial 1 to be compatible with SQuADDS."
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 2,
"metadata": {},
"outputs": [],
"source": []
@@ -165,6 +160,25 @@
"---"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Show how to add this new data entry to the SQuADDS database by creating a PR. \n",
+ "\n",
+ "1. Code to fork the repo and create a new branch.\n",
+ "2. Code to add the new data to the chosen configuration.\n",
+ "3. Code to commit and push the changes.\n",
+ "4. Code to create a PR."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -213,6 +227,31 @@
"If all the `sim_results` has the same units you can just use a `\"units\":units` field instead of repeating the unit for each result."
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Metadata:\n",
+ "\n",
+ "The metadata for the configuration should include \n",
+ "\n",
+ "- the name of the configuration\n",
+ "- a description of the configuration\n",
+ "- contributors to the configuration\n",
+ "- device design, design tool and name\n",
+ "- simulation setup and simulator name\n",
+ "- simulation code `Simulator`\n",
+ "- simulation result parameters\n",
+ "- measured parameters"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Code to help generate portions of the metadata and guide the user to create custom `Simulator` (future release and tutorial)"
+ ]
+ },
{
"cell_type": "code",
"execution_count": null,
@@ -258,6 +297,19 @@
"7. **Create a Pull Request**: Go to the Hugging Face Hub, navigate to your fork, and create a pull request for your new branch. The pull request will be reviewed by the dataset maintainers."
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Show \n",
+ "\n",
+ "1. Code to fork the repo and create a new branch.\n",
+ "2. Code to add the new data to a new configuration.\n",
+ "3. Code to add metadata to the configuration.\n",
+ "4. Code to commit and push the changes.\n",
+ "5. Code to create a PR."
+ ]
+ },
{
"cell_type": "code",
"execution_count": null,
@@ -279,6 +331,17 @@
"We might have some data that can be appended to an existing dataset in SQuADDS. In this case, we can add to the existing configuration in `SQuADDS_DB` without pushing new entries to the original dataset."
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "1. Code to fork the repo and create a new branch.\n",
+ "2. Code to add the new data to the chosen configuration.\n",
+ " - handling contributions (appending code gives uploader name and institute only and notes)\n",
+ "3. Code to commit and push the changes.\n",
+ "4. Code to create a PR."
+ ]
+ },
{
"cell_type": "code",
"execution_count": null,