qsci_algo_interface
¶
QSCI and TE-QSCI algorithm implementations compatible with quri-algo interface.
This module provides algorithm objects that conform to quri-algo's algorithm interface, enabling seamless integration with QURI SDK ecosystem.
Classes:
Name | Description |
---|---|
LoweringLevel |
Analysis lowering levels for quantum circuits. |
AlgorithmResult |
Base class for algorithm results. |
Algorithm |
Base class for all algorithms. |
Analysis |
Analysis of algorithm resource requirements. |
CircuitAnalysisMixin |
Mixin for algorithms that support circuit analysis. |
QuantumAlgorithm |
Base class for quantum algorithms with circuit analysis. |
QSCIAlgorithmResult |
Result wrapper for QSCI algorithms compatible with quri-algo interface. |
QSCIAnalysis |
Analysis implementation for QSCI algorithms. |
QSCIAlgorithmBase |
Base class for QSCI algorithms compatible with quri-algo interface. |
VanillaQSCIAlgorithm |
Vanilla QSCI algorithm compatible with quri-algo interface. |
SingleTimeTeQSCIAlgorithm |
Single-time TE-QSCI algorithm compatible with quri-algo interface. |
TimeAverageTeQSCIAlgorithm |
Time-average TE-QSCI algorithm compatible with quri-algo interface. |
StateVectorTeQSCIAlgorithm |
State vector TE-QSCI algorithm compatible with quri-algo interface. |
Functions:
Name | Description |
---|---|
create_qsci_algorithm |
Factory function to create QSCI algorithm variants. |
Attributes:
Name | Type | Description |
---|---|---|
T |
|
LoweringLevel
¶
Bases: Enum
Analysis lowering levels for quantum circuits.
Attributes:
Name | Type | Description |
---|---|---|
LogicalCircuit |
|
|
ArchLogicalCircuit |
|
|
ArchInstruction |
|
|
DeviceInstruction |
|
AlgorithmResult
¶
Bases: ABC
Base class for algorithm results.
Attributes:
Name | Type | Description |
---|---|---|
algorithm |
|
|
elapsed_time |
|
|
name |
str
|
The name of the algorithm. |
Source code in src/qsci_algo_interface.py
Algorithm
¶
Analysis
¶
Analysis(
lowering_level,
circuit_gate_count,
circuit_depth,
circuit_latency,
circuit_execution_count,
circuit_fidelities,
circuit_qubit_count,
)
Bases: ABC
Analysis of algorithm resource requirements.
Attributes:
Name | Type | Description |
---|---|---|
lowering_level |
|
|
circuit_gate_count |
|
|
circuit_depth |
|
|
circuit_latency |
|
|
circuit_execution_count |
|
|
circuit_fidelities |
|
|
circuit_qubit_count |
|
|
total_latency |
TimeValue
|
Total latency of the circuit is algorithm dependent. |
max_physical_qubit_count |
int
|
Maximum physical qubit count is algorithm dependent. |
Source code in src/qsci_algo_interface.py
CircuitAnalysisMixin
¶
Mixin for algorithms that support circuit analysis.
Methods:
Name | Description |
---|---|
analyze |
The quantum resource analysis of the algorithm. |
QuantumAlgorithm
¶
Bases: Algorithm
, CircuitAnalysisMixin
, ABC
Base class for quantum algorithms with circuit analysis.
Methods:
Name | Description |
---|---|
analyze |
The quantum resource analysis of the algorithm. |
run |
Run the algorithm itself. |
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the algorithm. |
analyze
abstractmethod
¶
QSCIAlgorithmResult
¶
Bases: AlgorithmResult
Result wrapper for QSCI algorithms compatible with quri-algo interface.
Attributes:
Name | Type | Description |
---|---|---|
qsci_result |
|
|
ground_state_energy |
float
|
Ground state energy from QSCI calculation. |
eigenvalues |
Sequence[float]
|
All computed eigenvalues. |
subspace_dimension |
int
|
Dimension of the selected subspace. |
algorithm |
|
|
elapsed_time |
|
|
name |
str
|
The name of the algorithm. |
Source code in src/qsci_algo_interface.py
QSCIAnalysis
¶
Bases: Analysis
Analysis implementation for QSCI algorithms.
Attributes:
Name | Type | Description |
---|---|---|
qsci_result |
|
|
total_latency |
TimeValue
|
Total latency for QSCI execution. |
max_physical_qubit_count |
int
|
Maximum physical qubit count required. |
lowering_level |
|
|
circuit_gate_count |
|
|
circuit_depth |
|
|
circuit_latency |
|
|
circuit_execution_count |
|
|
circuit_fidelities |
|
|
circuit_qubit_count |
|
Source code in src/qsci_algo_interface.py
QSCIAlgorithmBase
¶
Bases: QuantumAlgorithm
Base class for QSCI algorithms compatible with quri-algo interface.
Methods:
Name | Description |
---|---|
analyze |
Analyze quantum resource requirements for QSCI algorithm. |
run |
Run the algorithm itself. |
Attributes:
Name | Type | Description |
---|---|---|
hamiltonian |
|
|
sampler |
|
|
num_states_pick_out |
|
|
name |
str
|
Algorithm name. |
Source code in src/qsci_algo_interface.py
analyze
¶
analyze(
input_states,
total_shots,
lowering_level=LogicalCircuit,
**kwargs
)
Analyze quantum resource requirements for QSCI algorithm.
Source code in src/qsci_algo_interface.py
VanillaQSCIAlgorithm
¶
Bases: QSCIAlgorithmBase
Vanilla QSCI algorithm compatible with quri-algo interface.
Methods:
Name | Description |
---|---|
run |
Run vanilla QSCI algorithm. |
analyze |
Analyze quantum resource requirements for QSCI algorithm. |
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
|
hamiltonian |
|
|
sampler |
|
|
num_states_pick_out |
|
Source code in src/qsci_algo_interface.py
run
¶
Run vanilla QSCI algorithm.
Source code in src/qsci_algo_interface.py
analyze
¶
analyze(
input_states,
total_shots,
lowering_level=LogicalCircuit,
**kwargs
)
Analyze quantum resource requirements for QSCI algorithm.
Source code in src/qsci_algo_interface.py
SingleTimeTeQSCIAlgorithm
¶
SingleTimeTeQSCIAlgorithm(
hamiltonian,
evolution_time,
sampler=None,
num_states_pick_out=None,
trotter_steps=None,
time_evolution_method="trotter",
)
Bases: QSCIAlgorithmBase
Single-time TE-QSCI algorithm compatible with quri-algo interface.
Methods:
Name | Description |
---|---|
run |
Run single-time TE-QSCI algorithm. |
analyze |
Analyze quantum resource requirements for QSCI algorithm. |
Attributes:
Name | Type | Description |
---|---|---|
evolution_time |
|
|
trotter_steps |
|
|
time_evolution_method |
|
|
name |
str
|
|
hamiltonian |
|
|
sampler |
|
|
num_states_pick_out |
|
Source code in src/qsci_algo_interface.py
run
¶
Run single-time TE-QSCI algorithm.
Source code in src/qsci_algo_interface.py
analyze
¶
analyze(
input_states,
total_shots,
lowering_level=LogicalCircuit,
**kwargs
)
Analyze quantum resource requirements for QSCI algorithm.
Source code in src/qsci_algo_interface.py
TimeAverageTeQSCIAlgorithm
¶
TimeAverageTeQSCIAlgorithm(
hamiltonian,
evolution_times,
sampler=None,
num_states_pick_out=None,
trotter_steps=None,
time_evolution_method="trotter",
)
Bases: QSCIAlgorithmBase
Time-average TE-QSCI algorithm compatible with quri-algo interface.
Methods:
Name | Description |
---|---|
run |
Run time-average TE-QSCI algorithm. |
analyze |
Analyze quantum resource requirements for QSCI algorithm. |
Attributes:
Name | Type | Description |
---|---|---|
evolution_times |
|
|
trotter_steps |
|
|
time_evolution_method |
|
|
name |
str
|
|
hamiltonian |
|
|
sampler |
|
|
num_states_pick_out |
|
Source code in src/qsci_algo_interface.py
run
¶
Run time-average TE-QSCI algorithm.
Source code in src/qsci_algo_interface.py
analyze
¶
analyze(
input_states,
total_shots,
lowering_level=LogicalCircuit,
**kwargs
)
Analyze quantum resource requirements for QSCI algorithm.
Source code in src/qsci_algo_interface.py
StateVectorTeQSCIAlgorithm
¶
StateVectorTeQSCIAlgorithm(
hamiltonian,
evolution_time,
num_states_pick_out=None,
time_evolution_method="exact",
)
Bases: QSCIAlgorithmBase
State vector TE-QSCI algorithm compatible with quri-algo interface.
Methods:
Name | Description |
---|---|
run |
Run state vector TE-QSCI algorithm. |
analyze |
Analyze quantum resource requirements for QSCI algorithm. |
Attributes:
Name | Type | Description |
---|---|---|
evolution_time |
|
|
time_evolution_method |
|
|
name |
str
|
|
hamiltonian |
|
|
sampler |
|
|
num_states_pick_out |
|
Source code in src/qsci_algo_interface.py
run
¶
Run state vector TE-QSCI algorithm.
Source code in src/qsci_algo_interface.py
analyze
¶
analyze(
input_states,
total_shots,
lowering_level=LogicalCircuit,
**kwargs
)
Analyze quantum resource requirements for QSCI algorithm.
Source code in src/qsci_algo_interface.py
create_qsci_algorithm
¶
create_qsci_algorithm(
variant,
hamiltonian,
sampler=None,
num_states_pick_out=None,
**variant_kwargs
)
Factory function to create QSCI algorithm variants.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
QSCIVariant
|
QSCI algorithm variant |
required |
|
Operator
|
Target Hamiltonian |
required |
|
Optional[ConcurrentSampler]
|
Quantum sampler |
None
|
|
Optional[int]
|
Number of states to select |
None
|
|
Variant-specific parameters |
{}
|
Returns:
Type | Description |
---|---|
QSCIAlgorithmBase
|
QSCI algorithm instance |