PennyLaneSpecStage¶
- class PennyLaneSpecStage[source]¶
Bases:
CircuitSpecStageSpecStage that converts PennyLane circuits into MetaCircuit(s).
Accepts
QuantumScriptorQNodeobjects (single, sequence, or mapping). QNodes are traced into a symbolicQuantumScript— the trainable arguments are seeded withsympysymbols — before conversion.QNode parameter handling:
Scalar parameters (
def circuit(x, y)) become sympy symbols.Single 1-D array parameter (
def circuit(params)), including PennyLane templates such asAngleEmbeddingandIQPEmbedding, is auto-sized to the device wire count and traced symbolically.Structured-shape or multiple array parameters (e.g.
StronglyEntanglingLayers, orcircuit(inputs, weights)) can’t be inferred here. Pass aQuantumScriptwith explicit sympy symbols, or useCustomVQA’sarg_shapes/data_argto declare the shapes.
Supported measurements:
probs(),expval(), andcounts(). Other PennyLane measurement types (sample,state,var, etc.) are not supported by the pipeline execution backend.Methods Summary
expand(batch, env)Convert PennyLane circuit(s) to MetaCircuit(s) and build a keyed batch.
Methods Documentation