repo_full_name
stringlengths
6
93
repo_url
stringlengths
25
112
repo_api_url
stringclasses
28 values
owner
stringclasses
28 values
repo_name
stringclasses
28 values
description
stringclasses
28 values
stars
int64
617
98.8k
forks
int64
31
355
watchers
int64
990
999
license
stringclasses
2 values
default_branch
stringclasses
2 values
repo_created_at
timestamp[s]date
2012-07-24 23:12:50
2025-06-16 08:07:28
repo_updated_at
timestamp[s]date
2026-02-23 15:23:15
2026-05-03 18:52:12
repo_topics
listlengths
0
13
repo_languages
unknown
is_fork
bool
1 class
open_issues
int64
3
104
file_path
stringlengths
3
208
file_name
stringclasses
509 values
file_extension
stringclasses
1 value
file_size_bytes
int64
101
84k
file_url
stringclasses
627 values
file_raw_url
stringclasses
627 values
file_sha
stringclasses
624 values
language
stringclasses
8 values
parsed_at
stringdate
2026-05-04 01:12:36
2026-05-04 19:41:55
text
stringlengths
100
102k
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/datasets/transforms/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:35:44.827660
from .compose import Compose from .custom import crop_and_resize from .torchvision_transforms import register_torchvision_transforms
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/datasets/transforms/torchvision_transforms.py
null
null
null
null
null
null
Python
2026-05-04T02:35:44.917784
from torchvision import transforms from mova.registry import TRANSFORMS def register_torchvision_transforms(): for cls_name, obj in transforms.__dict__.items(): if cls_name[0].isupper(): TRANSFORMS.register_module(name=f'TV{cls_name}', module=obj) register_torchvision_transforms()
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
configs/training/mova_train_accelerate.py
null
null
null
null
null
null
Python
2026-05-04T02:35:44.959336
# ============================================================ # MOVA LoRA Training Configuration # ============================================================ # -------------------------------------------------- # Model Configuration # -------------------------------------------------- diffusion_pipeline = dict( ...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/models/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:35:45.384502
from .wan_audio_dit import WanAudioModel from .wan_video_dit import WanModel, sinusoidal_embedding_1d
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/models/wan_audio_dit.py
null
null
null
null
null
null
Python
2026-05-04T02:35:45.449506
""" Code adapted from DiffSynth-Studio's Wan DiT implementation: https://github.com/modelscope/DiffSynth-Studio/blob/main/diffsynth/models/wan_video_dit.py """ import math from typing import Literal, Optional, Tuple import torch import torch.nn as nn from diffusers.configuration_utils import ConfigMixin, register_to_...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/models/wan_video_dit.py
null
null
null
null
null
null
Python
2026-05-04T02:35:45.453429
""" Code adapted from DiffSynth-Studio's Wan DiT implementation: https://github.com/modelscope/DiffSynth-Studio/blob/main/diffsynth/models/wan_video_dit.py """ import math from typing import Optional, Tuple import torch import torch.nn as nn import torch.nn.functional as F from diffusers.configuration_utils import Co...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/models/interactionv2.py
null
null
null
null
null
null
Python
2026-05-04T02:35:45.465588
import torch import torch.nn as nn import torch.nn.functional as F from typing import Dict, List, Tuple, Optional from einops import rearrange from .wan_video_dit import RMSNorm, AttentionModule # modified from https://github.com/huggingface/transformers/blob/b0db5a02f39ebd2ccffd7f8eb77091fda61f9a1e/src/transformer...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/pipelines/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:35:45.476681
from .pipeline_mova import MOVA from .mova_train import MOVATrain from .mova_lora import MOVALoRA
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/pipelines/mova_lora.py
null
null
null
null
null
null
Python
2026-05-04T02:35:45.506594
""" MOVA LoRA inference Pipeline """ import os import torch from typing import Optional, List, Union, Any from mova.diffusion.pipelines.pipeline_mova import MOVA ACCELERATE_TRAINER_TRAINED = os.getenv('ACCELERATE_TRAINER_TRAINED', '1') if ACCELERATE_TRAINER_TRAINED: from mova.engine.trainer.accelerate.lora_utils...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/datasets/video_audio_dataset.py
null
null
null
null
null
null
Python
2026-05-04T02:35:45.540057
import json import os import numpy as np import torch import torchvision.transforms.functional as TF from torch.utils.data import Dataset from torchcodec.decoders import AudioDecoder, VideoDecoder from torchvision.transforms import InterpolationMode from mova.registry import DATASETS @DATASETS.register_module() cl...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/models/dac_vae.py
null
null
null
null
null
null
Python
2026-05-04T02:35:45.593628
""" Code adapted from HunyuanVideo-Foley's DAC VAE implementation: https://github.com/Tencent-Hunyuan/HunyuanVideo-Foley/tree/main/hunyuanvideo_foley/models/dac_vae We modified the original code to fit this project (e.g., integration and refactors). """ import math from dataclasses import dataclass from pathlib import...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/pipelines/mova_train.py
null
null
null
null
null
null
Python
2026-05-04T02:35:45.606894
import os import re import ftfy import html import math import torch import torch.nn as nn from functools import partial from typing import Any, Optional, Dict, List, Literal, Union import torch.distributed as dist from torch.distributed.device_mesh import DeviceMesh from diffusers.pipelines import DiffusionPipeline ...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/pipelines/pipeline_mova.py
null
null
null
null
null
null
Python
2026-05-04T02:35:45.975940
import copy import gc import html import os import re from contextlib import nullcontext from functools import partial from typing import Any, List, Literal, Optional, Tuple, Union import ftfy import torch import torch.distributed as dist from diffusers.configuration_utils import register_to_config from diffusers.imag...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/schedulers/flow_match.py
null
null
null
null
null
null
Python
2026-05-04T02:35:46.050478
""" Code adapted from DiffSynth-Studio's Wan DiT implementation: https://github.com/modelscope/DiffSynth-Studio/blob/main/diffsynth/diffusion/flow_match.py """ import torch, math from mova.registry import DIFFUSION_SCHEDULERS @DIFFUSION_SCHEDULERS.register_module() class FlowMatchScheduler(): def __init__( ...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/schedulers/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:35:46.073614
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler from .flow_match_pair import FlowMatchPairScheduler from .flow_match import FlowMatchScheduler from mova.registry import DIFFUSION_SCHEDULERS DIFFUSION_SCHEDULERS.register_module( name="FlowMatchEulerDiscreteScheduler", module=FlowMatchEulerDiscret...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/diffusion/schedulers/flow_match_pair.py
null
null
null
null
null
null
Python
2026-05-04T02:35:46.074878
import math import torch from diffusers.configuration_utils import ConfigMixin, register_to_config from diffusers.schedulers.scheduling_utils import SchedulerMixin from .flow_match import FlowMatchScheduler from mova.registry import DIFFUSION_SCHEDULERS @DIFFUSION_SCHEDULERS.register_module() class FlowM...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/distributed/functional.py
null
null
null
null
null
null
Python
2026-05-04T02:35:46.088326
import torch import torch.distributed as dist import torch.distributed.nn.functional as dist_fn from torch.distributed.nn.functional import _Reduce_Scatter, _AlltoAll from torch.distributed import ProcessGroup, ReduceOp, Backend from torch.autograd import Function class _AllGatherAvg(Function): @staticme...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/engine/optimizers/bnb_optimizers.py
null
null
null
null
null
null
Python
2026-05-04T02:35:46.200462
"""Register bitsandbytes 8-bit optimizers if available. This module registers `Adam8bit` and `AdamW8bit` from bitsandbytes (if installed) to the `OPTIMIZERS` registry so they can be referred in configs as `optimizer.type = "Adam8bit"` or `"AdamW8bit"`. """ from mova.registry import OPTIMIZERS from bitsandbytes import...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/engine/optimizers/torch_optimizers.py
null
null
null
null
null
null
Python
2026-05-04T02:35:46.953115
import inspect import torch from mova.registry import OPTIMIZERS def register_torch_optimizers(): """Register optimizers in ``torch.optim`` to the ``OPTIMIZERS`` registry. """ torch_optimizers = [] for module_name in dir(torch.optim): if module_name.startswith('__'): c...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/engine/trainer/accelerate/accelerate_trainer.py
null
null
null
null
null
null
Python
2026-05-04T02:35:47.015249
""" Accelerate + FSDP Trainer Supports: - Automatic mixed precision (AMP) - Fully sharded data parallel (FSDP) - Gradient checkpointing - DeepSpeed """ import os, re import torch from tqdm import tqdm try: from accelerate import Accelerator from accelerate.utils import ProjectConfiguration ACCELERATE_A...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/engine/trainer/low_resource/lora_layers.py
null
null
null
null
null
null
Python
2026-05-04T02:35:47.016981
""" LoRA (Low-Rank Adaptation) Layers This module implements LoRA layers for efficient fine-tuning of large models. LoRA decomposes weight updates into low-rank matrices, significantly reducing the number of trainable parameters. Reference: https://arxiv.org/abs/2106.09685 """ import torch import torch.nn as nn impo...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/engine/trainer/low_resource/low_resource_trainer.py
null
null
null
null
null
null
Python
2026-05-04T02:35:47.018217
""" Low Resource Trainer for MOVA LoRA Training This trainer implements memory-efficient training using: 1. LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning 2. Gradient checkpointing to reduce activation memory 3. Optional 8-bit optimizer to reduce optimizer state memory 4. Optional FP8 CPU offloading fo...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/registry.py
null
null
null
null
null
null
Python
2026-05-04T02:35:47.539195
from mmengine.registry import Registry DATASETS = Registry( 'dataset', locations=['mova.datasets'], # triggered build_from_cfg() => Registry.get() => Registry.import_from_location() ) TRANSFORMS = Registry( 'transform', locations=['mova.datasets.transforms'], ) DIFFUSION_PIPELINES = Regi...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/engine/trainer/accelerate/lora_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:35:47.542199
""" LoRA (Low-Rank Adaptation) utilities Supports: - Dynamically inject LoRA layers into existing models - Save/load LoRA weights - Compatible with PEFT format """ import os import re import torch import torch.nn as nn from typing import List, Optional, Dict, Any, Union from diffusers import DiffusionPipeline clas...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/engine/trainer/utils/logger.py
null
null
null
null
null
null
Python
2026-05-04T02:35:47.543208
""" Logging system - supports WandB + TensorBoard """ import os import time from typing import Dict, Any, Optional from abc import ABC, abstractmethod class BaseLogger(ABC): """Base logger class""" @abstractmethod def log(self, metrics: Dict[str, Any], step: int): pass @abstractmeth...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
scripts/inference_single.py
null
null
null
null
null
null
Python
2026-05-04T02:35:48.092606
import argparse import os import torch import torch.distributed as dist from PIL import Image from torch.distributed.device_mesh import DeviceMesh from yunchang.kernels import AttnType from mova.datasets.transforms.custom import crop_and_resize from mova.diffusion.pipelines.pipeline_mova import MOVA from mova.utils.d...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
scripts/inference_single_lora.py
null
null
null
null
null
null
Python
2026-05-04T02:35:48.100805
#!/usr/bin/env python3 """ MOVA LoRA Inference Script """ import os import argparse import torch import torch.distributed as dist from torch.distributed.device_mesh import DeviceMesh from PIL import Image from mova.diffusion.pipelines import MOVALoRA from mova.utils.data import save_video_with_audio from mova.dataset...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/utils/misc.py
null
null
null
null
null
null
Python
2026-05-04T02:35:48.101525
import time import torch from contextlib import contextmanager from contextlib import ExitStack def str_to_torch_dtype(dtype_string): mapping = { # Float types 'float32': torch.float32, 'float': torch.float32, 'fp32': torch.float32, 'float16': torch.float16, 'half':...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
scripts/training_scripts/accelerate_train.py
null
null
null
null
null
null
Python
2026-05-04T02:35:48.204067
#!/usr/bin/env python3 """ MOVA Training Script (Accelerate + FSDP + LoRA) """ import os import argparse import torch import torch.distributed as dist from torch.distributed.device_mesh import DeviceMesh from torch.utils.data import DataLoader from mmengine.config import Config, DictAction from mova.registry import D...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
workflow/api_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:35:48.217688
#!/usr/bin/env python3 """ API 工具函数 - DashScope / Gemini 等 API 调用的公共逻辑 """ import os from typing import Optional, Tuple from config import DASHSCOPE_BASE_URL def resolve_api_keys( api_key: Optional[str] = None, qwen_api_key: Optional[str] = None, ) -> Tuple[str, str]: """ 统一解析 Gemini 和 DashScope/Qwe...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
workflow/app.py
null
null
null
null
null
null
Python
2026-05-04T02:35:48.231924
#!/usr/bin/env python3 """ SGLang Video Generation Workflow - Streamlit App A web interface for video generation using SGLang server. Supports both Full Workflow (with AI-assisted prompt generation) and Simple Mode. """ import streamlit as st import os import json import time import subprocess from pathlib import Pat...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
scripts/training_scripts/low_resource_train.py
null
null
null
null
null
null
Python
2026-05-04T02:35:48.656802
#!/usr/bin/env python3 """ MOVA Low Resource LoRA Training Script This script implements memory-efficient training using: 1. LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning 2. Gradient checkpointing to reduce activation memory 3. Optional 8-bit optimizer to reduce optimizer state memory 4. Optional FP8 ...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
workflow/prompt_rewriter_with_image.py
null
null
null
null
null
null
Python
2026-05-04T02:35:48.990225
#!/usr/bin/env python3 """ 增强版Prompt Rewriter - 结合首帧图元素和用户输入生成VIDEO_DESCRIPTION 功能: 1. 接收首帧图的视觉元素描述(来自Qwen-VL) 2. 接收用户的原始输入(描述动作、情节、音效等) 3. 生成与首帧图一致的完整VIDEO_DESCRIPTION 后端:有 GEMINI_API_KEY 时使用 Gemini 2.5 Pro;否则使用 DashScope qwen-plus。 参考: https://help.aliyun.com/zh/model-studio/qwen-api-via-dashscope """ import argpa...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
workflow/generate_first_frame.py
null
null
null
null
null
null
Python
2026-05-04T02:35:49.003117
#!/usr/bin/env python3 """ 首帧图生成脚本(合并版) 功能: 1. prompt: 将用户描述改写为首帧图生成提示词 (Gemini 2.5 Pro 或 通义千问 qwen-plus) 2. generate: 使用提示词生成首帧图 (Gemini 2.5 Flash Image 或 通义 Z-Image) 3. full: 完整流程(prompt + generate)一次完成 提示词生成:有 GEMINI_API_KEY 用 Gemini;否则用 DashScope qwen-plus。 图片生成:有 GEMINI_API_KEY 用 Gemini Flash Image;否则用通义文生图 Z-Im...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
workflow/config.py
null
null
null
null
null
null
Python
2026-05-04T02:35:49.894190
#!/usr/bin/env python3 """ Configuration for SGLang Streamlit Workflow Contains server endpoints, API keys, and default parameters. """ import os # ============================================================================ # SGLang Server Configuration # ============================================================...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/engine/trainer/utils/fp8_cpu_offload.py
null
null
null
null
null
null
Python
2026-05-04T02:35:51.804090
""" FP8 CPU Offload Manager This module implements a memory-efficient weight management system that: 1. Stores model weights in FP8 format on CPU 2. Transfers weights to GPU and dequantizes only when needed for computation 3. Quantizes and offloads weights back to CPU after computation This allows training very large...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/engine/utils/base_pipeline.py
null
null
null
null
null
null
Python
2026-05-04T02:35:51.987891
""" Code adapted from DiffSynth-Studio's base pipeline implementation: https://github.com/modelscope/DiffSynth-Studio/blob/main/diffsynth/diffusion/base_pipeline.py """ import warnings from PIL import Image from einops import repeat, reduce import torch import torch.nn as nn from torchvision.transforms.functional impo...
OpenMOSS/MOVA
https://github.com/OpenMOSS/MOVA
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
mova/utils/data.py
null
null
null
null
null
null
Python
2026-05-04T02:35:52.689164
import os import shutil import subprocess import tempfile import wave import imageio import numpy as np import torch from tqdm import tqdm try: import imageio_ffmpeg as _imageio_ffmpeg except ImportError: # pragma: no cover _imageio_ffmpeg = None def _write_wav_wave(audio, wav_path, sample_rate=44100): ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.085737
from .main import run from .debug import logger from .cache import cached from .index_page import index_page from .equalities import register_equality from .component_mixins import Boxy, Styled, Interactive, Slottable, Togglable from .design_tokens import ( Spacing, Shadow, BorderRadius, FontFamily, ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/cli.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.091613
#!/usr/bin/env python import sys import os import click import shutil from importlib.metadata import version def get_version(): # Note: This assumes that hyperdiv is installed in the current # virtualenv or distribution. This assumption holds when # developing locally with poetry, because `poetry install...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/cache.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.139816
import traceback from functools import wraps from cachetools.keys import hashkey from textwrap import dedent from termcolor import colored from .frame import AppRunnerFrame from .debug import timing from .collector import ShadowCollector from .component_keys import get_component_key from .component_base import Componen...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/app_runner.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.143164
import time from queue import Queue, Empty import traceback import threading import json from textwrap import dedent from termcolor import colored from .diff import diff, diff_mutations from .frame import ( AppRunnerFrame, StateAccessFrame, ResetUIEventsFrame, RenderFrame, UIUpdatesFrame, ) from .ui...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/application_state.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.148358
import threading from .prop import StoredProp class ApplicationState: """Holds persistent prop state.""" def __init__(self): self.state = dict() self.state_lock = threading.RLock() def _update(self, key, prop_name, value): with self.state_lock: return self.state[key][...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/collector.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.150230
class Collector: """ The base class that collects the children of Hyperdiv components that can have children. Should not be instantiated directly. """ def __init__(self): self._children = [] def _collect_child(self, child): self._children.append(child) def _extend(sel...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/component_mixins/boxy.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.156211
from ..prop_types import Bool, CSSField, OneOf, Optional, Size from ..prop import Prop class DirectionDef(CSSField): """ Represents the layout direction of @component(box) components. """ def __init__(self): super().__init__( "flex-direction", OneOf( No...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/component_mixins/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.235073
from .boxy import Boxy from .interactive import Interactive from .styled import Styled from .slottable import Slottable from .togglable import Togglable
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/component_base.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.251343
import asyncio from functools import cache from .prop import Prop from .frame import AppRunnerFrame, StateAccessFrame, TaskFrame from .renderer import render_component from .slot import Slot from .collector import Collector from .component_keys import ( get_component_key, validate_component_key, register_co...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/component_keys.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.292640
import os import inspect import xxhash from .frame import AppRunnerFrame runtime_py_path = os.path.join( os.path.dirname(os.path.abspath(__file__)), "app_runner.py" ) def validate_component_key(key): key = str(key) if len(key) == 0 or not key[0].isalpha(): return False for char in key: ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/component_mixins/interactive.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.628855
from ..prop_types import BoolEvent from ..prop import Prop class Interactive: """ A collection of props defining how a component can generally be interacted with. Currently only `clicked` is supported. """ # Whether the component was clicked. clicked = Prop(BoolEvent, False) def __init__...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/component_mixins/slottable.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.648237
from ..prop_types import HyperdivType from ..slot import Slot from ..prop import Prop class SlotTypeDef(HyperdivType): """ The type of Hyperdiv component slots. """ def parse(self, value): if value is None: return None if not isinstance(value, Slot): raise Valu...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/component_mixins/styled.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.699274
from ..prop_types import ( CSS, Native, Color, Border, BorderEdge, BoxSize, CSSField, Int, OneOf, Optional, Size, Union, DesignToken, BaseSize, ) from ..prop import Prop from .. import design_tokens as tokens from .slottable import Slottable class BackgroundGrad...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/component_mixins/togglable.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.740772
from ..prop import Prop from ..prop_types import Bool, BoolEvent class Togglable: """ A collection of props representing a component that can be opened and closed. """ # Whether this component is visible opened = Prop(Bool, False, ui_name="open") # Whether the visibility of this component...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/alert.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.810698
from ..component_mixins.togglable import Togglable from ..slot import Slot from ..prop import Prop from ..prop_types import Bool, Float from ..style_part import StylePart, BasePart from .common.label_component import LabelComponent from .common.shoelace_types import ShoelaceVariant from .icon import icon class alert(...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/animation.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.847131
from ..prop_types import ( Bool, ClampedFloat, ClampedInt, Constant, HyperdivType, Int, List, OneOf, Optional, String, Union, ) from ..prop import Prop from ..frame import AppRunnerFrame from ..component_base import Component, BaseState from ..component_mixins.slottable impor...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/anchor.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.848209
from ..component_base import Component class anchor(Component): """Creates an invisible anchor that can be linked to using a location hash. When navigating to an anchor link, the page auto-scrolls to where the anchor is. ```py-nodemo # Create an anchor hd.anchor("my-anchor") # A link to ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/component_mixins/tests/component_mixins_tests.py
null
null
null
null
null
null
Python
2026-05-04T02:35:55.870873
import pytest from ...slot import Slot from ...test_utils import mock_frame from ...component_base import Component from ..boxy import Scroll, Direction, Boxy from ..interactive import Interactive from ..slottable import Slottable, SlotType from ..styled import Styled, BackgroundGradient, TextGradient from ..togglable ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/async_command.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.194600
from ..component_base import BaseState from ..prop import Prop from ..prop_types import Bool, Optional, String, Any class async_command(BaseState): """ This component represents the result of calling an asynchronous command. This component is not usable directly, so there is no user-facing need to eve...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/audio.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.204105
from .common.media_base import MediaBase class audio(MediaBase): """ A simple component for playing audio files in the browser. The look & feel of the component is currently browser-dependent. ```py src = "https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3" audio = h...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/avatar.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.306444
from ..prop_types import OneOf, String, CSSField, Size from ..prop import Prop from ..component_base import Component from ..component_mixins.styled import Styled from ..component_mixins.interactive import Interactive from ..style_part import StylePart, BasePart class avatar(Component, Styled, Interactive): """ ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/badge.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.322742
from ..prop_types import Bool from ..prop import Prop from ..component_mixins.interactive import Interactive from ..style_part import BasePart from .common.label_component import LabelComponent from .common.shoelace_types import ShoelaceVariant class badge(LabelComponent, Interactive): """ A badge component, ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/box.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.398924
from functools import partial from ..component_base import Component from ..component_mixins.boxy import Boxy from ..component_mixins.styled import Styled class box(Component, Boxy, Styled): """ `box` is the fundamental layout component in Hyperdiv. Its box props give you flexible control over how the ch...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/box_list_item.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.418419
from .box import box from .list_item import list_item class box_list_item(list_item, box): """ A list item component that can be nested in a @component(box_list). By contrast to @component(list_item), `box_list_item` subclasses @component(box), giving flexible control over how its children are al...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/breadcrumb.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.428840
from ..prop_types import String from ..prop import Prop from ..component_base import Component from ..slot import Slot from ..component_mixins.styled import Styled from ..style_part import BasePart class breadcrumb(Component, Styled): """ This component renders a breadcrumb trail useful in building naviga...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/button.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.452621
from ..prop_types import OneOf, Bool from ..prop import Prop from ..slot import Slot from ..component_mixins.interactive import Interactive from ..style_part import BasePart, StylePart from .common.label_component import LabelComponent from .common.shoelace_types import ShoelaceSize from .icon import icon class butto...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/box_list.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.490566
from .box import box from .box_list_item import box_list_item class box_list(box): """ Renders a list of @component(box_list_item)s. By contrast to @component(list) and @component(ordered_list), `box_list` does not render a bullet point or number on its children, and subclasses @component(box), g...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/breadcrumb_item.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.491674
from ..prop_types import OneOf, Optional, String from ..prop import Prop from ..slot import Slot from ..component_mixins.interactive import Interactive from ..style_part import BasePart, StylePart from .common.label_component import LabelComponent from .common.text_utils import concat_text from .plaintext import plaint...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/button_group.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.774718
from ..prop_types import String from ..prop import Prop from ..component_base import Component from ..component_mixins.styled import Styled from ..style_part import BasePart class button_group(Component, Styled): """ A container that visually groups together a set of related @component(button)s. ```p...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/card.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.883992
from ..prop_types import Color, CSSField, Union, DesignToken, BoxSize, Size from ..prop import Prop from ..component_base import Component from ..slot import Slot from ..component_mixins.styled import Styled from .. import design_tokens as tokens from ..style_part import BasePart, StylePart class card(Component, Styl...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/carousel.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.884523
from ..prop_types import Bool, Int, OneOf, CSSField, StringEvent, Size from ..prop import Prop from ..component_base import Component from ..slot import Slot from ..component_mixins.styled import Styled from .common.shoelace_types import CarouselAspectRatio from ..style_part import BasePart, StylePart from .carousel_it...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.982911
from .chart import chart from .cartesian_chart import cartesian_chart from .line_chart import line_chart from .bar_chart import bar_chart from .scatter_chart import scatter_chart from .bubble_chart import bubble_chart from .pie_chart import pie_chart from .polar_chart import polar_chart from .radar_chart import radar_c...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/bar_chart.py
null
null
null
null
null
null
Python
2026-05-04T02:35:56.995963
from .cartesian_chart import cartesian_chart def bar_chart( *datasets, labels=None, colors=None, grid_color="neutral-100", x_axis="linear", y_axis="linear", hide_legend=False, show_x_tick_labels=True, show_y_tick_labels=True, y_min=None, y_max=None, **kwargs, ): """...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/bubble_chart.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.005084
from .cartesian_chart import cartesian_chart def bubble_chart( *datasets, labels=None, colors=None, grid_color="neutral-100", x_axis="linear", y_axis="linear", hide_legend=False, show_x_tick_labels=True, show_y_tick_labels=True, y_min=None, y_max=None, **kwargs, ): ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/carousel_item.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.006580
from ..prop import Prop from ..component_base import Component from ..component_mixins.styled import Styled from .common.shoelace_types import CarouselAspectRatio # TODO: carousel_item doesn't respond to style props class carousel_item(Component, Styled): """ To be used with @component(carousel). """ ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/cartesian_chart.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.015504
from ...prop_types import Color from .chart import chart from .common.color_utils import auto_color_generator cartesian_chart_types = ("line", "bar", "scatter", "bubble") def check_chart_type(chart_type): if chart_type not in cartesian_chart_types: raise ValueError(f"Invalid cartesian chart type: {chart_...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/chart.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.114373
from ...component_base import Component from ...component_mixins import Styled from ...prop_types import Any from ...prop import Prop class chart(Component, Styled): """ The base chart component. This component exposes a single prop containing the entire chart config that is ultimately passed to [Char...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/common/color_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.387644
from ....prop_types import Color auto_colors = [ "blue", "orange", "green", "red", "yellow", "purple", "neutral", "amber", "fuchsia", "violet", "lime", "pink", "teal", ] def auto_color_generator(): i = 0 while True: if i >= len(auto_colors): ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/line_chart.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.466156
from .cartesian_chart import cartesian_chart def line_chart( *datasets, labels=None, colors=None, grid_color="neutral-100", x_axis="linear", y_axis="linear", hide_legend=False, show_x_tick_labels=True, show_y_tick_labels=True, y_min=None, y_max=None, **kwargs, ): ""...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/common/radial_chart_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.482094
from .color_utils import pad_colors def get_radial_chart_config(chart_type, dataset, labels, colors, hide_legend): if not dataset: raise ValueError("Nothing to render in a chart.") if labels and len(labels) != len(dataset): raise ValueError("Length of `dataset` differs from length of `labels`...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/scatter_chart.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.570239
from .cartesian_chart import cartesian_chart def scatter_chart( *datasets, labels=None, colors=None, grid_color="neutral-100", x_axis="linear", y_axis="linear", hide_legend=False, show_x_tick_labels=True, show_y_tick_labels=True, y_min=None, y_max=None, **kwargs, ): ...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/polar_chart.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.578446
from ...prop_types import Color from .chart import chart from .common.radial_chart_utils import get_radial_chart_config def polar_chart( dataset, labels=None, colors=None, grid_color="neutral-100", hide_legend=False, show_tick_labels=True, r_min=None, r_max=None, **kwargs, ): "...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/radar_chart.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.579124
from ...prop_types import Color from .chart import chart from .common.color_utils import pad_colors def radar_chart( *datasets, labels=None, axis=None, colors=None, grid_color="neutral-100", hide_legend=False, show_tick_labels=True, r_min=None, r_max=None, **kwargs, ): """A...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/pie_chart.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.648380
from .chart import chart from .common.radial_chart_utils import get_radial_chart_config def pie_chart( dataset, labels=None, colors=None, hide_legend=False, doughnut=True, **kwargs, ): """ A good ol pie chart. `dataset` holds the numeric sizes of the slices. ```py hd.pie_c...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/checkbox.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.682091
from ..prop_types import Bool, String, BoolEvent from ..prop import Prop from ..style_part import BasePart, StylePart from .common.label_component import LabelComponent from .common.shoelace_types import ShoelaceSize from .common.text_utils import concat_text class checkbox(LabelComponent): """ A checkbox com...
hyperdiv/hyperdiv
https://github.com/hyperdiv/hyperdiv
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
hyperdiv/components/charts/tests/chart_tests.py
null
null
null
null
null
null
Python
2026-05-04T02:35:57.725031
import pytest from ....test_utils import mock_frame from ....prop_types import Color from ...box import box from ...scope import scope from ..cartesian_chart import cartesian_chart from ..bar_chart import bar_chart from ..line_chart import line_chart from ..scatter_chart import scatter_chart from ..bubble_chart import ...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/bellpair_circuit.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.151857
# pylint: skip-file """Example implementation of a quantum circuit generating a Bell pair state.""" import matplotlib.pyplot as plt from teleport import create_bell_pair from projectq import MainEngine from projectq.backends import CircuitDrawer from projectq.libs.hist import histogram from projectq.setups.default i...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/hws6.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.152756
# pylint: skip-file """Example of a 6-qubit phase function.""" import revkit from projectq.cengines import MainEngine from projectq.libs.revkit import PermutationOracle, PhaseOracle from projectq.meta import Compute, Dagger, Uncompute from projectq.ops import All, H, Measure, X # phase function def f(a, b, c, d, e...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/control_tester.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.156390
# Copyright 2021 ProjectQ-Framework (www.projectq.ch) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/ibm.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.157749
# pylint: skip-file """Example of running a quantum circuit using the IBM QE APIs.""" import getpass import matplotlib.pyplot as plt import projectq.setups.ibm from projectq import MainEngine from projectq.backends import IBMBackend from projectq.libs.hist import histogram from projectq.ops import All, Entangle, Me...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/gate_zoo.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.176321
# pylint: skip-file """Showcase most of the quantum gates available in ProjectQ.""" import os import sys from projectq import MainEngine from projectq.backends import CircuitDrawer from projectq.ops import ( CNOT, QFT, All, Barrier, BasicMathGate, C, Entangle, H, Measure, Ph, ...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
docs/package_description.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.177366
# Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/grover.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.191001
# pylint: skip-file """Example implementation of Grover's algorithm.""" import math from projectq import MainEngine from projectq.meta import Compute, Control, Loop, Uncompute from projectq.ops import All, H, Measure, X, Z def run_grover(eng, n, oracle): """ Run Grover's algorithm on n qubit using the prov...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/hws4.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.220677
# pylint: skip-file """Example of a 4-qubit phase function.""" from projectq.cengines import MainEngine from projectq.libs.revkit import PhaseOracle from projectq.meta import Compute, Uncompute from projectq.ops import All, H, Measure, X # phase function def f(a, b, c, d): """Phase function.""" return (a an...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/aqt.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.254553
# pylint: skip-file """Example of running a quantum circuit using the AQT APIs.""" import getpass import matplotlib.pyplot as plt import projectq.setups.aqt from projectq import MainEngine from projectq.backends import AQTBackend from projectq.libs.hist import histogram from projectq.ops import All, Entangle, Measu...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/quantum_random_numbers.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.742393
# pylint: skip-file """Example of a simple quantum random number generator.""" from projectq import MainEngine from projectq.ops import H, Measure # create a main compiler engine eng = MainEngine() # allocate one qubit q1 = eng.allocate_qubit() # put it in superposition H | q1 # measure Measure | q1 eng.flush() ...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/ionq.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.743553
# Copyright 2021 ProjectQ-Framework (www.projectq.ch) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/ionq_half_adder.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.745289
# Copyright 2021 ProjectQ-Framework (www.projectq.ch) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/quantum_random_numbers_ibm.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.777368
# pylint: skip-file """Example of a simple quantum random number generator using IBM's API.""" import projectq.setups.ibm from projectq import MainEngine from projectq.backends import IBMBackend from projectq.ops import H, Measure # create a main compiler engine eng = MainEngine(IBMBackend(), engine_list=projectq.se...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/ionq_bv.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.778789
# Copyright 2021 ProjectQ-Framework (www.projectq.ch) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/shor.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.780851
# pylint: skip-file """Example implementation of Shor's algorithm.""" import math import random import sys from fractions import Fraction try: from math import gcd except ImportError: from fractions import gcd import projectq.libs.math import projectq.setups.decompositions from projectq.backends import Reso...
ProjectQ-Framework/ProjectQ
https://github.com/ProjectQ-Framework/ProjectQ
null
null
null
null
972
null
null
apache-2.0
null
null
null
null
null
null
null
examples/teleport.py
null
null
null
null
null
null
Python
2026-05-04T02:36:00.801906
# pylint: skip-file """Example of a quantum teleportation circuit.""" from projectq import MainEngine from projectq.meta import Control, Dagger from projectq.ops import CNOT, H, Measure, Rz, X, Z def create_bell_pair(eng): r""" Create a Bell pair state with two qubits. Returns a Bell-pair (two qubits i...