Using the Pinch-Off 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
1from dotenv import load_dotenv
2import os
3from conductorquantum import ConductorQuantum
4
5# Load API key from .env file
6load_dotenv()
7TOKEN = os.getenv("CONDUCTOR_API_KEY")
8
9# Initialize client
10client = ConductorQuantum(token=TOKEN)

Or provide the API key directly:

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

Usage Examples

Using the Pinch-Off Classifier

The Pinch-Off Classifier is a model that can classify a given current measurement as either exhibiting Pinch-Off or not.

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

Python
1from dotenv import load_dotenv
2import os
3import numpy as np
4from conductorquantum import ConductorQuantum
5
6
7# Load API key from .env file
8load_dotenv()
9TOKEN = os.getenv("CONDUCTOR_API_KEY")
10
11# Initialize client
12client = ConductorQuantum(token=TOKEN)
13
14# Load Pinch-off data (current measurement)
15data = np.load("pinch-off-classifier-v0.npy") # shape (n, )
16
17# Detect Pinch-off
18result = client.models.execute(
19 model="pinch-off-classifier-v0",
20 data=data
21)
22
23# Access the classification result
24is_pinch_off = result.output["classification"]
25print(f"Is pinch-off: {is_pinch_off}")
Output
1Is pinch-off: True

Using the Pinch-Off Parameter Extractor

The Pinch-Off 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
1from dotenv import load_dotenv
2import os
3import numpy as np
4from conductorquantum import ConductorQuantum
5
6
7# Load API key from .env file
8load_dotenv()
9TOKEN = os.getenv("CONDUCTOR_API_KEY")
10
11# Initialize client
12client = ConductorQuantum(token=TOKEN)
13
14# Load Pinch-off data (current measurement)
15data = np.load("pinch-off-parameter-extractor-v0.npy") # shape (n, )
16
17# Detect Pinch-off
18result = client.models.execute(
19 model="pinch-off-parameter-extractor-v0",
20 data=data
21)
22
23# Access the peak locations (indices)
24pinch_off_parameters = result.output
25print(f"Pinch-off parameters: {pinch_off_parameters}")
Output
1Pinch-off parameters: {'cut_off_index': 31, 'transition_index': 43, 'saturation_index': 54}

Plotting the Output

Python
1import matplotlib.pyplot as plt
2
3plt.figure(figsize=(10, 5), dpi=300)
4plt.plot(example_input, 'k-')
5plt.axvline(x=result_api.output["cut_off_index"], color='b', linestyle='--', label='Cutoff Index')
6plt.axvline(x=result_api.output["transition_index"], color='g', linestyle='--', label='Transition Index')
7plt.axvline(x=result_api.output["saturation_index"], color='r', linestyle='--', label='Saturation Index')
8plt.xlabel('Voltages (Indices)')
9plt.ylabel('Current (a.u.)')
10plt.legend()
11plt.show()
Pinch-off Parameter Extractor
Pinch-off Parameter Extractor v0 Output

Data Requirements

One-dimensional Current Data

  • Shape: (n, )
  • 1D array of current values

Important Notes for Voltage-Current Data

  • The array must be of shape (n, ) where n is the number of current values in the measurement.
  • Analysis is outputted in terms of indices of the input array.
  • The models automatically handle scaling and normalization internally.
  • For best results, ensure your data has sufficient resolution in regions of interest.