probability_calculator
¶
Dual exact/sampling probability calculator for TE-QSCI excitation analysis.
This module implements both exact and sampling-based probability calculation methods for analyzing excitation probabilities in time-evolved quantum states.
Classes:
Name | Description |
---|---|
ProbabilityCalculator |
Dual exact/sampling probability calculator for quantum states. |
H6FigureOneAnalyzer |
Specialized analyzer for reproducing Figure 1 with H6 molecule. |
ProbabilityCalculator
¶
Dual exact/sampling probability calculator for quantum states.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
"exact", "sampling", or "auto" for automatic selection |
'auto'
|
|
bool
|
Whether to print progress information |
True
|
Methods:
Name | Description |
---|---|
select_states_at_t1 |
Select top R states at t=1 and classify by excitation order. |
calculate_probabilities |
Calculate probabilities for selected states using chosen method. |
calculate_grouped_probabilities |
Calculate grouped probabilities for Figure 1 reproduction. |
Attributes:
Name | Type | Description |
---|---|---|
method |
|
|
verbose |
|
|
sampler |
|
|
exact_qubit_threshold |
|
|
exact_state_threshold |
|
Source code in src/probability_calculator.py
select_states_at_t1
¶
select_states_at_t1(
evolved_state_t1, n_electrons, n_qubits, R=850
)
Select top R states at t=1 and classify by excitation order.
Always uses exact calculation for state selection regardless of method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
GeneralCircuitQuantumState
|
Quantum state evolved to t=1 |
required |
|
int
|
Number of electrons in the system |
required |
|
int
|
Number of qubits in the system |
required |
|
int
|
Number of top states to select |
850
|
Returns:
Type | Description |
---|---|
Tuple[ndarray, Dict[int, List[int]]]
|
Tuple of (selected_state_indices, state_orders_dict) |
Source code in src/probability_calculator.py
calculate_probabilities
¶
calculate_probabilities(
evolved_state,
selected_states,
n_qubits,
method_override=None,
)
Calculate probabilities for selected states using chosen method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
GeneralCircuitQuantumState
|
Time-evolved quantum state |
required |
|
ndarray
|
Array of selected state indices |
required |
|
int
|
Number of qubits |
required |
|
Optional[str]
|
Override the default method selection |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Array of probabilities for selected states |
Source code in src/probability_calculator.py
calculate_grouped_probabilities
¶
calculate_grouped_probabilities(
probabilities, selected_state_orders, selected_states
)
Calculate grouped probabilities for Figure 1 reproduction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
ndarray
|
Probabilities for selected states |
required |
|
Dict[int, List[int]]
|
Dictionary mapping excitation order to state indices |
required |
|
ndarray
|
Array of selected state indices |
required |
Returns:
Type | Description |
---|---|
Tuple[float, float, float]
|
Tuple of (prob_1_2, prob_3_4, prob_5_6) for grouped excitation orders |
Source code in src/probability_calculator.py
H6FigureOneAnalyzer
¶
H6FigureOneAnalyzer(
hamiltonian,
hartree_fock_state,
active_space,
method="auto",
)
Specialized analyzer for reproducing Figure 1 with H6 molecule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
H6 Hamiltonian operator |
required | |
|
Hartree-Fock initial state |
required | |
|
Active space information |
required | |
|
str
|
Probability calculation method |
'auto'
|
Methods:
Name | Description |
---|---|
run_figure_one_analysis |
Run complete Figure 1 analysis for H6. |
Attributes:
Name | Type | Description |
---|---|---|
hamiltonian |
|
|
hartree_fock_state |
|
|
active_space |
|
|
calculator |
|
|
n_electrons |
|
|
n_qubits |
|
Source code in src/probability_calculator.py
run_figure_one_analysis
¶
run_figure_one_analysis(R=850, time_points=None)
Run complete Figure 1 analysis for H6.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
int
|
Number of states to select (paper uses R=850) |
850
|
|
Optional[ndarray]
|
Custom time points (default: focus on small-t regime) |
None
|
Returns:
Type | Description |
---|---|
Dict
|
Dictionary containing all analysis results |
Source code in src/probability_calculator.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
|