Skip to content

QuantumEPR

Run a quantum simulation using Energy Participation Ratio (EPR) analysis.

This class orchestrates a distributed HFSS simulation, extracts participation data for defined junctions, and computes the quantum χ (chi) matrix via numerical diagonalization.

The energy-participation-ratio method is based on: "Energy-participation quantization of Josephson circuits"
DOI: 10.1038/s41534-021-00461-8

Bases: BaseAnalysis

Runs an EPR-based quantum simulation using Eigenmode results and junction data.

This analysis calculates energy participation ratios (EPR), anharmonicities, and the chi matrix for quantum circuit modes. It integrates multiple simulation stages into a high-level quantum post-processing workflow.

The energy-participation-ratio method is based on: "Energy-participation quantization of Josephson circuits" DOI: https://doi.org/10.1038/s41534-021-00461-8

Attributes:

Name Type Description
type Literal[QUANTUM_EPR]

Simulation type identifier (always set to 'quantum_epr').

design_name str

Name of the HFSS design to use.

setup_name str

Name of the HFSS setup that has Eigenmode results.

modes_to_labels ModesToLabels | dict[int, str]

Either a parser or mapping from mode index to label.

junctions_infos list[ConfigJunction]

Configuration objects describing the Josephson junctions.

analyze

analyze(hfss: Hfss) -> QuantumResults

Run the full EPR simulation and return results.

This includes distributed EM simulation, participation ratio extraction, and EPR matrix diagonalization.

Parameters:

Name Type Description Default
hfss Hfss

An active HFSS project instance.

required

Returns:

Name Type Description
QuantumResults QuantumResults

Final output containing EPR matrix, participation data, and labeled eigenmode results.

Raises:

Type Description
ValueError

If hfss is not a valid Hfss instance.

Source code in src/quansys/simulation/quantum_epr/model.py
def analyze(self, hfss: Hfss) -> QuantumResults:
    """
    Run the full EPR simulation and return results.

    This includes distributed EM simulation, participation ratio extraction,
    and EPR matrix diagonalization.

    Args:
        hfss: An active HFSS project instance.

    Returns:
        QuantumResults: Final output containing EPR matrix, participation data, and labeled eigenmode results.

    Raises:
        ValueError: If `hfss` is not a valid Hfss instance.
    """

    if not isinstance(hfss, Hfss):
        raise ValueError('hfss given must be a Hfss instance')

    validate_and_set_design(hfss, self.design_name)

    # getting setup and getting
    setup = hfss.get_setup(self.setup_name)

    # getting eigenmode solution in simple form, meaning it is
    # of type dict[int, dict[str, float]
    # where the keys are the mode number and the values are frequency dict and quality factor dict
    eigenmode_result = get_eigenmode_results(setup)

    # convert modes to labels to dict of int to str
    # in case of ModesToLabels object call for parse
    modes_to_labels = self.modes_to_labels

    if isinstance(modes_to_labels, ModesToLabels):
        modes_to_labels = modes_to_labels.parse(eigenmode_result.generate_simple_form())

    epr, distributed = self._analyze(hfss, modes_to_labels)

    return QuantumResults(
        epr=epr,
        distributed=distributed,
        eigenmode_result=eigenmode_result.generate_a_labeled_version(modes_to_labels)
    )