Load Classical Data With Data Loading
Submit a classical-to-quantum data-loading job and return polling context.
Use this tool when the caller needs a generated circuit from classical data
before execution or later circuit analysis. The request must use one of the
supported dl_type values, and the response schema is a lightweight
{"context": ...} wrapper rather than a structured job object.
When to Use:
- Call this when classical data must be turned into a circuit before execution or later circuit analysis.
- Call this when the user has already chosen a concrete data-loading
mode such as
DistributionLoadingorVectorLoading.
Constraints:
dl_typemust be exactly one ofDistributionLoading,VectorLoading,BlockVectorLoading,MpsLoading, orEntangledManifoldEmbedding.- MCP-layer validation checks required parameter keys for the selected
mode and enforces the
BlockVectorLoadingexclusivity rule. - The MCP layer does not reject every unknown extra key or fully validate parameter value domains before delegating to the backend.
Notes:
DistributionLoadingprepares a probability distribution state.VectorLoadingprepares an arbitrary real or complex vector state.MpsLoadingprepares an arbitrary state from a matrix product state.BlockVectorLoadingprepares a block-wise vector or matrix state.EntangledManifoldEmbeddingencodes real data into a quantum state with controllable entanglement.- After submission, callers should use
get_job_results_and_statusto retrieve terminal outputs such as the generated circuit ID.
Args:
user: Authenticated user resolved from the API key.
data: Data-loading payload. dl_type must be exactly one of
DistributionLoading, VectorLoading, BlockVectorLoading,
MpsLoading, or EntangledManifoldEmbedding.
db: Active database session.
Returns: A lightweight context wrapper summarizing the submission and next polling step.
Raises:
HTTPException: Raised with 404 if the experiment is unavailable for
the user, or 400 if payload validation fails.
Authorizations
Body
Define payload for MCP classical-to-quantum data loading jobs.
MCP-layer validation is limited to mode-specific required-key checks plus
the BlockVectorLoading exclusivity rule implemented by
:func:haiqu.api.mcp.data_loading.validation.validate_data_loading_payload.
Attributes:
experiment_id: Parent experiment identifier for the data-loading job.
name: Optional job name.
dl_type: Data-loading mode selector.
parameters: Mode-specific parameters forwarded to the backend.
num_qubits: Optional qubit count. Required for
DistributionLoading.
distribution_name: Distribution identifier required for
DistributionLoading.
Mode-specific parameters. For DistributionLoading: distribution_name, num_qubits, interval_start, interval_end, loc, scale, num_layers, truncation_cutoff (+ optional scipy distribution shape args). For VectorLoading: data, num_layers, truncation_cutoff, fine_tuning_iterations. For BlockVectorLoading: data, (num_blocks or target_num_qubits), num_layers, truncation_cutoff, fine_tuning_iterations. For EntangledManifoldEmbedding: data, density, real, periodicity, num_layers, truncation_cutoff, fine_tuning_iterations. For MpsLoading: mps, shape, num_layers, truncation_cutoff, fine_tuning_iterations.
Data loading mode. Use one of: DistributionLoading, VectorLoading, BlockVectorLoading, EntangledManifoldEmbedding, MpsLoading.
DistributionLoading, VectorLoading, BlockVectorLoading, EntangledManifoldEmbedding, MpsLoading Optional qubit count. Required for DistributionLoading; optional for VectorLoading and EntangledManifoldEmbedding; ignored for BlockVectorLoading.
Required for DistributionLoading (e.g. norm, uniform, beta).
Response
Successful Response
Represent context payload returned after data-loading submission.
Attributes:
context: Submission summary text including the created job ID and next
polling step. This response model does not expose structured
job_id or output circuit_id fields outside the text.