npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

qni-cli

v0.2.2

Published

Deterministic quantum circuit CLI and Pi skill for Qni CoResearcher

Readme

Qni CoResearcher

Qni CoResearcher は、研究者が AI共同研究者と量子回路を設計し、実行結果を検証し、図と文章で説明し、その過程を後から確認できる形で残すためのプロジェクトです。研究者は CLI の操作ではなく、調べたい量子回路や確かめたい性質を自然言語で伝えるところから始められます。

qni-cli は、その共同研究を支えるエージェント向けの決定論的な量子回路 CLI です。Qni CoResearcher が共同研究の進め方と記録を含むプロジェクト全体を指すのに対し、qni-cli は回路の作成、実行、表示、検証を同じ入力から再現できる道具です。人が直接使うこともできます。

Pi で試す

Pi に qni-cli と同梱スキルを導入します。

pi install npm:qni-cli

空の作業ディレクトリで Pi を起動し、次のように依頼します。

超密度符号化回路を qni-cli で作り、ランダムに生成した入力2ビットと復号した出力2ビットが各ショットで一致することを確認してください。16ショットを seed 42 で実行し、通常出力と JSON 出力を示してください。回路図を PNG で保存し、もつれの準備、符号化、復号、測定の役割を説明してください。

同じ回路を再現するコマンド列は examples/superdense-coding/circuit.qni にあります。次の回路図と測定結果は、そのコマンド列を実行した後の qni-cli 自身の出力です。

回路図

qni view の出力:

    ┌───┐┌────────────────────┐
q0: ┤ H ├┤ Measure>input_high ├──────────────────────────────────────────────────────────────────────────
    ├───┤├───────────────────┬┘
q1: ┤ H ├┤ Measure>input_low ├───────────────────────────────────────────────────────────────────────────
    └───┘└───────────────────┘ ┌───┐     ┌──────────────┐┌─────────────┐     ┌───┐┌─────────────────────┐
q2: ───────────────────────────┤ H ├──■──┤ Z<input_high ├┤ X<input_low ├──■──┤ H ├┤ Measure>output_high ├
                               └───┘┌─┴─┐└──────────────┘└─────────────┘┌─┴─┐└───┘├────────────────────┬┘
q3: ────────────────────────────────┤ X ├───────────────────────────────┤ X ├─────┤ Measure>output_low ├─
                                    └───┘                               └───┘     └────────────────────┘

q0 と q1 の測定で2ビットをランダムに作ります。q2 と q3 に Bell 対を準備し、入力に応じて q2 へ Z と X を適用します。逆 Bell 回路で復号すると、q2 と q3 の測定値が入力と一致します。

測定結果

qni run --shots 16 --seed 42 の出力:

shots=16 seed=42
input_high | input_low | output_high | output_low | count
0          | 0         | 0           | 0          | 4
0          | 1         | 0           | 1          | 3
1          | 0         | 1           | 0          | 6
1          | 1         | 1           | 1          | 3

すべての行で入力と出力が一致します。作成手順、JSON 出力、PNG 出力は超密度符号化の端から端の例にあります。

現在地とロードマップ

| 状態 | 研究者ができること | | --- | --- | | 利用可能 | Pi に目的を伝え、qni-cli で量子回路を作成・実行・表示・検証する | | 利用可能 | 回路図を SVG・PNG・LaTeX で、1量子ビット状態を Bloch sphere で可視化する | | 利用可能 | ベンチマークを採点し、研究試行を記録・比較する | | 整備中 | Pi 上で回路図や数式を自然にインライン表示する | | 構想 | Jupyter・marimo の編集とノートブック内での対話 | | 構想 | 複数エージェント・複数スキルによる研究分担 |

「利用可能」は現在の公開コマンドで再現できる範囲です。「整備中」と「構想」は未提供の機能であり、現在使えるものとしては扱いません。

現在使えること

  • 回路を作成・編集し、状態ベクトル、測定値、複数ショットの分布を実行結果として得る
  • 測定結果に名前を付け、その古典ビットを条件に後続のゲートを実行する
  • 出力された乱数 seed を指定し、通常表示または JSON の結果を再現する
  • 端末の回路図、LaTeX 不要の SVG、PNG、LaTeX、状態ベクトル画像、Bloch sphere を生成する
  • 状態ベクトルや期待値を使って回路の性質を検証する
  • ベンチマーク提出物を検証・採点し、研究試行を記録・比較する
  • Pi 経由のモデル筆記試験を実行し、モデルごとの正答率とコストを比較する

コマンドと引数の一覧は CLI コマンドリファレンスを参照してください。

CLI を直接使う

人が qni-cli を直接使う場合は npm からグローバルに導入します。インストール後のコマンド名は qni です。

npm install --global qni-cli
qni --help

qni は現在の作業ディレクトリにある circuit.json を読み書きします。たとえば Bell 対は次のように作成して確認できます。

qni add H --qubit 0 --step 0
qni add X --control 0 --qubit 1 --step 1
qni view
qni run

関連文書

開発への参加

Issue と Pull Request を歓迎します。新機能は、実装前に features/ 以下の機能仕様で利用者から見える振る舞いを定義してください。開発環境の準備と npm run check を含む検証手順は開発者向け手順にあります。

Qni CoResearcher / qni-cli は MIT License で公開しています。