SpinorioSpinorio
Help Center
Open Lab
Browse documentation

Docs / Guided tutorials / Compile and compare with Weylattice

Compile and compare with Weylattice

Compile for a reference target, compare a standard baseline, and reuse the saved output.


LEARN INSIDE YOUR LAB

Compile and compare with Weylattice

Open your personal practice notebook with a guide beside it. Follow real circuits and results, and resume whenever you are ready.

Open lesson in Lab

No IBM account required ยท Sign in to save your progress

What you will be able to do

You can evaluate compilation trade-offs for the same source and target, then reuse a preserved compiled circuit.

Allow 5โ€“8 minutes; compiler queue time can vary. Your progress is saved when you complete a step in the Lab guide.

  • A Python notebook kernel
  • Weylattice and circuit preservation enabled
  • No IBM account required

1. Prepare a circuit to compile

Run the notebook code cell. Wait for the circuit and its preserved QPY artifact.

Why this helps

The compiler uses a specific preserved circuit version.

2. Compile for a reference target

Open Compile. The lesson selects your source and the five-qubit linear reference target. Review Level 2 and click Compile Circuit.

Why this helps

A reference target lets you explore compilation without submitting a physical QPU job.

3. Read the compilation result

Open the saved result and inspect depth, two-qubit gates, and compilation time.

Why this helps

Adapting to a target may add gates or depth. These numbers describe the implementation, not measured answer accuracy.

4. Run a standard baseline

Open the comparison and click Run standard baseline. Wait for both runs to complete.

Why this helps

Compare the same source, target, and optimization level. Weylattice is not guaranteed to win on every metric or circuit.

5. Interpret the trade-offs

Inspect both columns. Consider depth, two-qubit count, and compilation time together.

Why this helps

A comparison records evidence for a choice. Gate counts alone do not establish equivalence or expected fidelity.

6. Reuse the compiled circuit

Open the saved result and choose Insert into notebook. The inserted cell loads this exact compilation when you execute it.

Why this helps

Your compiled output remains available through its saved compilation ID.

The notebook you will run

Compile and compare with Weylattice This example uses four logical qubits with non-local interactions. The guide uses the offline five-qubit linear reference target. Compilation consumes compiler resources but does not submit a physical QPU job.

python
from qiskit import QuantumCircuit

qc = QuantumCircuit(4, name="Weylattice guided example")
qc.h(0)
qc.ry(0.3, 1)
qc.cx(0, 3)
qc.cx(1, 2)
qc.rz(0.7, 3)
qc.cx(0, 2)
qc.cx(3, 1)
print("Source depth:", qc.depth())
print("Source operations:", dict(qc.count_ops()))

Reuse your compilation After completing the comparison, open the completed Weylattice result and select **Insert into notebook**. Execute the inserted client.compile.get(job_id).result() cell to load its saved output. A lower gate count does not by itself prove equivalent computation or improved measured fidelity.

Apply this to your own work

Create or open your own notebook and repeat the task with your circuit. Practice notebooks remain in Spinorio Tutorials. Lesson execution uses your normal Lab and compiler resources.


Previous

โ† Understand what changed

Next

Spinorio Lab โ†’