Cover image
Try Now
2025-03-22

用于量子计算

3 years

Works with Finder

1

Github Watches

1

Github Forks

9

Github Stars

Quantum Simulator MCP Server

A Docker image providing a quantum circuit simulator that implements the Model Context Protocol (MCP), allowing integration with MCP clients such as Claude for Desktop.

Features

  • Quantum computing simulator with noise models
  • Support for OpenQASM 2.0 quantum circuits
  • Quantum circuit simulation using Qiskit
  • Support for various noise models (depolarizing, thermal relaxation, readout error)
  • Multiple result types including counts, statevector, and visualized histograms
  • Pre-configured example circuits
  • Seamless integration with MCP clients

Quick Start

get the docker image

docker pull ychen94/quantum-simulator-mcp:latest

Simply run the container with the following command:

docker run -i --rm -v /tmp:/data/quantum_simulator_results -e HOST_OUTPUT_DIR="/tmp" ychen94/quantum-simulator-mcp:latest

This command:

  • Mounts the /tmp directory on your host to store histogram output files
  • Sets the HOST_OUTPUT_DIR environment variable to /tmp
  • Keeps the container running with -i (interactive mode)
  • Automatically removes the container when it exits with --rm

Using with Claude for Desktop

  1. Install Claude for Desktop

  2. Edit the Claude configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. Add the following configuration to the mcpServers section:

{
  "mcpServers": {
    "quantum-simulator": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v", "/tmp:/data/quantum_simulator_results",
        "-e", "HOST_OUTPUT_DIR=/tmp",
        "ychen94/quantum-simulator-mcp:latest"
      ]
    }
  }
}
  1. Restart Claude for Desktop
  2. Look for the hammer icon in the Claude UI, indicating available MCP tools

MCP Tools

The server provides the following MCP tools:

  • run_circuit: Run a quantum circuit with specified noise model
  • list_noise_models: List all available noise models and their descriptions
  • list_result_types: List all available result types and their descriptions
  • get_circuit_stats: Analyze a quantum circuit and return statistics
  • create_test_histogram: Create a test histogram file to verify output directory configuration

MCP Resources

The server provides example quantum circuits:

  • qasm://examples/bell-state.qasm: Bell state preparation circuit
  • qasm://examples/grover-2qubit.qasm: 2-qubit Grover's algorithm implementation
  • qasm://examples/qft-4qubit.qasm: 4-qubit Quantum Fourier Transform
  • quantum://noise-models/examples.json: Example noise model configurations

Example Usage in Claude

Here are some prompts you can use in Claude:

  1. "Run a Bell state circuit and show me the results"

  2. "What noise models are available in the quantum simulator?"

  3. "Simulate a 2-qubit Grover's algorithm with 0.01 depolarizing noise"

  4. "Create a test histogram and show me the file path"

  5. "Please provide a simple QAOA algorithm, only get the result_types: histogram, and view the histogram using iterm"

chat

result_pic

Volume Mapping

The container generates histogram PNG files in /data/quantum_simulator_results. These files need to be accessible from your host system. The volume mapping (-v /tmp:/data/quantum_simulator_results) makes these files available in your host's /tmp directory.

Environment Variables

  • QUANTUM_OUTPUT_DIR: Output directory for histogram files inside the container (default: /data/quantum_simulator_results)
  • HOST_OUTPUT_DIR: Corresponding path on the host system (default: /tmp)

Multi-Architecture Support

This image supports the following architectures:

  • linux/amd64
  • linux/arm64 (confirmed working on Mac M-series chips)

Note: The image has not been tested on Windows systems yet, but should work as long as Docker Desktop is properly configured.

Troubleshooting

Issue: Claude cannot access the histogram files.
Solution: Ensure the volume mapping is correct and the HOST_OUTPUT_DIR environment variable matches the host path in your volume mapping.

Issue: Docker container exits immediately.
Solution: Make sure to use the -i flag to keep stdin open, which is required for the MCP STDIO transport.

License

This project is licensed under the MIT License. For more details, please see the LICENSE file in this project repository.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Lists Tailwind CSS classes in monospaced font

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

    Reviews

    3 (1)
    Avatar
    user_63MkZA6P
    2025-04-15

    MCP-Agg by moosh3 is an outstanding Multi-Channel Platform Aggregator that has streamlined my digital workflow tremendously. The interface is user-friendly, and integrating multiple platforms becomes seamless. This tool optimizes work efficiency, and the consistent updates ensure it keeps improving. Highly recommend checking it out at https://mcp.so/server/mcp-agg/moosh3!