Skip to navigation

Using the Turn-On Models

Installation

We recommend using pip, poetry, or uv to install the package.

pip install conductorquantum

Authentication

The SDK requires an API key for authentication. Sign in and create a new API key. Remember, your API key is your access secret - keep it safe with environment variables.

Using environment variables:

Python
from dotenv import load_dotenv
import os
from conductorquantum import ConductorQuantum
# Load API key from .env file
load_dotenv()
TOKEN = os.getenv("CONDUCTOR_API_KEY")
# Initialize client
client = ConductorQuantum(token=TOKEN)

Or provide the API key directly:

Python
from conductorquantum import ConductorQuantum
# Initialize client with API key
client = ConductorQuantum(token="YOUR_API_KEY")

Usage Examples

Using the Turn-On Classifier

The Turn-On Classifier is a model that can classify a given current measurement as either in the Turn-On regime or not.

You can download an example file to follow along with the example:

Python
from dotenv import load_dotenv
import os
import numpy as np
from conductorquantum import ConductorQuantum
# Load API key from .env file
load_dotenv()
TOKEN = os.getenv("CONDUCTOR_API_KEY")
# Initialize client
client = ConductorQuantum(token=TOKEN)
# Load Turn-on data (current measurement)
data = np.load("turn-on-classifier-v0.npy") # shape (n, )
# Detect Turn-on
result = client.control.models.run(
model="turn-on-classifier-v0",
data=data
)
# Access the classification result
is_turn_on = result.output["classification"]
print(f"Is turn-on: {is_turn_on}")
Output
Is turn-on: True

Using the Turn-On Parameter Extractor

The Turn-On Parameter Extractor is a model that can extract the parameters of a given current measurement.

You can download an example file to follow along with the example:

Python
from dotenv import load_dotenv
import os
import numpy as np
from conductorquantum import ConductorQuantum
# Load API key from .env file
load_dotenv()
TOKEN = os.getenv("CONDUCTOR_API_KEY")
# Initialize client
client = ConductorQuantum(token=TOKEN)
# Load Turn-on data (current measurement)
data = np.load("turn-on-parameter-extractor-v0.npy") # shape (n, )
# Detect Turn-on
result = client.control.models.run(
model="turn-on-parameter-extractor-v0",
data=data
)
# Access the peak locations (indices)
threshold_index = result.output["threshold_idx"]
print(f"Threshold index: {threshold_index}")
Output
Threshold index: 52

Plotting the Output

Python
import matplotlib.pyplot as plt
plt.figure(figsize=(10, 5), dpi=300)
plt.plot(data, 'k-')
plt.axvline(x=result.output["threshold_idx"], color='b', linestyle='--', label='Threshold Index')
plt.xlabel('Voltages (Indices)')
plt.ylabel('Current (a.u.)')
plt.legend()
plt.show('turn-on-parameter-extractor.png')
Turn-on Parameter Extractor
Turn-on Parameter Extractor v0 Output

Important Notes for Turn-On Models

  • Input dimensions: Input dimensions should ideally match the specified resolution of the model for the best results. You may need to interpolate or downsample your data to match the required shape. You can find the required input shapes for each model on the models overview page.
  • Data format: Input data should be a 1D numpy array representing current measurements as a function of gate voltage.
  • Output format:
    • The classifier outputs a boolean value (True or False) indicating whether the measurement exhibits turn-on behavior.
    • The parameter extractor outputs a dictionary with a threshold_idx key, which indicates the index where the turn-on threshold occurs.
  • Model versions: Higher version numbers typically indicate improved accuracy and performance. Check the models overview for the latest available versions.