Manual Inference¶
ManualInference assigns a specific label to a specific mode number, regardless of its properties.
Usage¶
To use an inference, call the .infer()
method with eigenmode results:
from quansys.simulation.quantum_epr.modes_to_labels import ManualInference
# Example eigenmode data
eigenmode_results = {
1: {'frequency': 3.5, 'quality_factor': 100},
2: {'frequency': 5.1, 'quality_factor': 120},
}
# Create inference: always assign mode 2 as 'bus'
inference = ManualInference(mode_number=2, label="readout")
# Apply inference
result = inference.infer(eigenmode_results)
print(result) # Output: {2: 'readout'}
.infer
The method .infer()
only validate the mode number exists in the eigenmode results.
Any other properties of the mode (like frequency or quality factor) are ignored.
Use Cases¶
- Reference modes: Fixed assignment for comparison across parameter sweeps
- Can be chained: can be combined with other inference strategies like
OrderInference
for more complex labeling scenarios
Bases: InferenceBase
Manual inference strategy to explicitly label a specific mode.
Attributes:
Name | Type | Description |
---|---|---|
type |
Literal['manual']
|
Discriminator field with value |
mode_number |
int
|
The eigenmode index to which the label should be assigned. |
label |
str
|
The label to assign. |
infer ¶
Assigns a predefined label to a specific mode number.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
eigenmode_results
|
dict[int, dict[str, float]]
|
Dictionary of available modes and their corresponding properties. |
required |
Returns:
Type | Description |
---|---|
dict[int, str]
|
dict[int, str]: A dictionary with a single key-value pair mapping the mode number to the label. |
Raises:
Type | Description |
---|---|
ValueError
|
If the mode number is not present in |