Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9343be6
Add liblsqecc slices-to-canvas importer (cube phase)
masa10-f Feb 8, 2026
8e9f329
Add ancilla and pipe conversion to liblsqecc importer
masa10-f Feb 8, 2026
642f424
Support direct qubit-to-qubit stitched pipes and relax ancilla block …
masa10-f Feb 8, 2026
90cb669
Add distillation factory detection and template expansion to liblsqec…
masa10-f Feb 8, 2026
c0a4bbb
Extract compile_canvas_to_pattern and fix init flow cycle avoidance
masa10-f Feb 8, 2026
1011502
add bulk measure blocks
masa10-f Feb 9, 2026
2ff7448
improve performance
masa10-f Feb 9, 2026
a8a4b99
Add configurable Plotly aspect ratio for 3D visualizers
masa10-f Feb 9, 2026
91807a6
Add coordinate-range filtering to GraphQOMB exporter
masa10-f Feb 9, 2026
eecd58c
Use physical-z pipe basis checks for init-flow candidate filtering
masa10-f Feb 9, 2026
6b4d30d
debug util func for cyclic flow problem
masa10-f Feb 9, 2026
d59f21b
add lsqecc json converter and profiling script
masa10-f Feb 9, 2026
94889ff
remove personal info
masa10-f Feb 9, 2026
b07a991
15-to-1 yml
masa10-f Feb 9, 2026
1245fb5
Add 3D z-sweep MP4 export with sliding window
masa10-f Feb 9, 2026
9671453
patch rotator with 2 mass
masa10-f Feb 9, 2026
ca827fe
handle patch rotation
masa10-f Feb 9, 2026
9c38a49
Fix export logical observable source
masa10-f Feb 10, 2026
d836aeb
Treat Distillation Cells As Qubits In Importer
masa10-f Feb 20, 2026
f2b280b
Add Stable Controls For 3D Z-Sweep Rendering
masa10-f Feb 20, 2026
ee6b94e
Add Profile Table And PTN Export To Example
masa10-f Feb 20, 2026
358ae5e
Adjust Example Spec Paths For Local Experiments
masa10-f Feb 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/canvas_layout_visualization_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
# =============================================================================
# Configuration - Edit these values
# =============================================================================
spec_name = "design/L_patch.yml"
spec_name = "/home/masato/git-repos/pyzx-mbqc/ls-pattern-compile/examples/output/adder_n4_slices_crop_x5-10_y5-11.yml"
code_distance = 3
target_z = 1
target_z = 2

# =============================================================================

Expand Down
37 changes: 37 additions & 0 deletions examples/canvas_z_sweep_3d_movie.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""Export a 3D z-sweep MP4 movie from a canvas YAML spec."""

from __future__ import annotations

from pathlib import Path

from lspattern.canvas_loader import load_canvas
from lspattern.video_3d import export_canvas_z_sweep_3d_mp4

spec_name = "design/distillation_canvas.yml"
code_distance = 5
z_window = 60
output_dir = Path(__file__).parent / "output"
output_dir.mkdir(parents=True, exist_ok=True)

canvas, spec = load_canvas(spec_name, code_distance=code_distance)
out_path = output_dir / f"{Path(spec_name).stem}_z_sweep_3d.mp4"

export_canvas_z_sweep_3d_mp4(
canvas,
out_path,
fps=15,
z_window=z_window,
width=640,
height=640,
node_size_scale=0.2,
edge_width_scale=0.2,
highlight_size_scale=1.0,
highlight_current_layer=True,
non_current_alpha=0.1,
camera_eye=(1.5, 1, 1),
lock_view=True,
aspect_ratio=(1.5, 0.9, 0.6),
show_progress_bar=True,
)

print(f"Exported 3D z-sweep for '{spec.name}' to {out_path}")
45 changes: 45 additions & 0 deletions examples/convert_liblsqecc_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""Convert liblsqecc slices JSON to canvas YAML.

This script converts liblsqecc output (slices JSON format) to the
canvas YAML format used by ls-pattern-compile.
"""

from __future__ import annotations

from pathlib import Path

from lspattern.importer.liblsqecc import (
convert_slices_file_to_canvas_yaml,
)

# =============================================================================
# Configuration - Edit these values
# =============================================================================
input_json = Path(
"/home/masato/git-repos/pyzx-mbqc/FTQC-compiler-survey/mf/e2edemo/output/adder_n4_slices_crop_x5-11_y5-11.json"
) # Path to liblsqecc slices JSON
output_dir = Path(__file__).parent / "output"

# =============================================================================

# Ensure output directory exists
output_dir.mkdir(parents=True, exist_ok=True)

yaml_path = output_dir / f"{input_json.stem}.yml"

print(f"Input JSON: {input_json}")
print(f"Output YAML: {yaml_path}")
print()

print("Converting liblsqecc slices JSON to canvas YAML...")
yaml_text = convert_slices_file_to_canvas_yaml(
input_json,
yaml_path,
name=input_json.stem,
description=f"Imported from {input_json.name}",
)

print(f" Generated YAML: {yaml_path}")
print(f" YAML size: {len(yaml_text):,} characters")
print()
print("Conversion completed successfully!")
Loading
Loading