Distributed
ampamp.distributed
Distributed Quantum Amplitude Amplification module.
Provides classes and utilities for partitioning global amplitude amplification problems into local sub-problems suitable for distributed quantum computing.
DQAAEngine
Core engine for Distributed Quantum Amplitude Amplification.
Handles prefix/suffix partitioning and local circuit generation.
__init__(global_n, j_prefixes)
Initializes the DQAA Engine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
global_n
|
int
|
The total number of qubits in the global system. |
required |
j_prefixes
|
int
|
The number of prefix bits used for partitioning. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If j_prefixes is not strictly between 0 and global_n. |
build_node_circuit(alphas, betas, local_targets)
Constructs the local FPAA circuit for a specific node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alphas
|
ndarray
|
Array of phase shifts for the local diffusion operator. |
required |
betas
|
ndarray
|
Array of phase shifts for the local oracle operator. |
required |
local_targets
|
list[str]
|
List of suffix target bitstrings for this processing node. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
QuantumCircuit |
QuantumCircuit
|
The constructed local quantum circuit. |
partition_targets(global_targets)
Maps global n-bit targets into node-local suffix targets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
global_targets
|
list[str]
|
A list of global target bitstrings. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, list[str]]
|
dict[str, list[str]]: A dictionary mapping prefix bitstrings to lists of suffix target bitstrings for each node. |
OracleSynthesizer
AST-level oracle partitioning compiler.
Uses SymPy to simplify global boolean formulas into node-local sub-oracles.
__init__(global_n, j, formula_text)
Initializes the AST-level oracle partitioning compiler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
global_n
|
int
|
The total number of qubits in the global system. |
required |
j
|
int
|
The number of prefix bits used for partitioning. |
required |
formula_text
|
str
|
The global boolean formula to be synthesized. |
required |
compile_node_formula(prefix)
Injects the node prefix into the AST, simplifies, and builds a PhaseOracle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prefix
|
str
|
The binary prefix string representing the current node. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
QuantumCircuit |
QuantumCircuit
|
The synthesized local phase oracle circuit. |