Skip to main content

A natural language interface for quantum programming using Cirq.

Project description

Zeeq: Quantum Natural Language Interpreter

Zeeq is a natural language-based interface for designing, simulating, and running quantum circuits using Cirq. It enables users to interact with quantum programming through intuitive English commands, making quantum computing accessible to everyone—from beginners to experienced developers.


Features and Commands

Zeeq supports a comprehensive range of commands for creating and manipulating quantum circuits. These commands are organized into intuitive categories for easy use.


1. Create a Circuit

  • Command:
    • Create a circuit with [number] qubits
  • Description: Initializes a quantum circuit with the specified number of qubits.
  • Example:
    • Create a circuit with 3 qubits

2. Apply Quantum Gates

Zeeq allows the application of quantum gates to specific qubits. Below is the list of supported gates:

Gate Command Description Example
H Apply Hadamard gate to qubit [n] Creates a superposition state for the specified qubit. Apply Hadamard gate to qubit 0
X Apply X gate to qubit [n] Flips the state of the specified qubit (quantum NOT gate). Apply X gate to qubit 1
Y Apply Y gate to qubit [n] Applies a Pauli-Y operation, flipping the qubit with a phase. Apply Y gate to qubit 2
Z Apply Z gate to qubit [n] Applies a phase flip to the qubit. Apply Z gate to qubit 0
RX Apply RX gate [angle] to qubit [n] Rotates the qubit around the X-axis by the specified angle (in radians). Apply RX gate 1.57 to qubit 0
RY Apply RY gate [angle] to qubit [n] Rotates the qubit around the Y-axis by the specified angle (in radians). Apply RY gate 3.14 to qubit 1
RZ Apply RZ gate [angle] to qubit [n] Rotates the qubit around the Z-axis by the specified angle (in radians). Apply RZ gate 1.0 to qubit 2
SWAP Apply SWAP gate between qubit [n] and qubit [m] Swaps the states of the two specified qubits. Apply SWAP gate between qubit 1 and qubit 2
CNOT Apply CNOT gate from qubit [control] to qubit [target] Creates entanglement between two qubits using a controlled NOT gate. Apply CNOT gate from qubit 0 to qubit 1
CZ Apply CZ gate from qubit [control] to qubit [target] Applies a controlled-Z gate between two qubits. Apply CZ gate from qubit 0 to qubit 1
Toffoli Apply Toffoli gate to qubits [control1], [control2], and [target] Applies a controlled-controlled NOT gate (Toffoli gate). Apply Toffoli gate to qubits 0, 1, and 2
Custom Gate Define a custom gate as [gate sequence] and apply to qubit [n] Defines a reusable custom gate and applies it to the specified qubit. Define a custom gate as [H, X] and apply to qubit 0

3. Entangle Qubits

  • Command:
    • Entangle qubits [n1] [n2] ...
  • Description: Entangles the specified qubits.
  • Example:
    • Entangle qubits 0 1 2

4. Apply Quantum Fourier Transform (QFT)

  • Command:
    • Apply QFT to all qubits
  • Description: Applies the Quantum Fourier Transform to all qubits in the circuit.
  • Example:
    • Apply QFT to all qubits

5. Measure Qubits

  • Command:
    • Measure all qubits
    • Measure qubit [n]
  • Description: Measures all or specific qubits and maps their states to classical bits.
  • Example:
    • Measure all qubits
    • Measure qubit 0

6. Reset Qubits

  • Command:
    • Reset all qubits
    • Reset qubit [n]
  • Description: Resets all or specific qubits to the ( |0\rangle ) state.
  • Example:
    • Reset all qubits
    • Reset qubit 1

7. Add Barriers

  • Command:
    • Add barrier to all qubits
    • Add barrier to qubits [n, m, ...]
  • Description: Adds barriers to separate operations visually or logically. (Simulated using comments in Cirq.)
  • Example:
    • Add barrier to all qubits
    • Add barrier to qubits 0 and 1

8. Display Circuit

  • Command: Display the circuit
  • Description: Outputs an ASCII representation of the current quantum circuit.
  • Example:
    • Display the circuit

9. Export Circuit

  • Command: Export the circuit to file [filename]
  • Description: Exports the quantum circuit to a file (e.g., JSON or Python) for external use.
  • Example:
    • Export the circuit to file circuit.json

10. Run the Circuit

  • Command: Run the circuit [number] times
  • Description: Executes the quantum circuit on a simulator and returns the result.
  • Example:
    • Run the circuit 1000 times

11. Visualize Bloch Sphere

  • Command: Draw Bloch sphere for qubit [n]
  • Description: Visualizes the quantum state of a specific qubit on the Bloch sphere (requires visualization libraries).
  • Example:
    • Draw Bloch sphere for qubit 0

Example Workflow

Create a circuit with 3 qubits  
Apply Hadamard gate to qubit 0  
Apply CNOT gate from qubit 0 to qubit 1  
Apply RX gate 1.57 to qubit 2  
Measure all qubits  
Run the circuit 1000 times  
Display the circuit  
Export the circuit to file example.json  

Why Use Zeeq?

  1. Simplifies Quantum Programming: Users can create and manipulate quantum circuits in plain English.
  2. Intuitive Commands: No need to learn Cirq syntax or quantum theory to get started.
  3. Versatile: Supports various quantum gates and operations for different applications.
  4. Beginner-Friendly: Designed for educational and professional use cases alike.

Zeeq bridges the gap between natural language and quantum programming, now leveraging Cirq for efficient quantum computing simulations!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zeeq-1.1.3.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zeeq-1.1.3-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file zeeq-1.1.3.tar.gz.

File metadata

  • Download URL: zeeq-1.1.3.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for zeeq-1.1.3.tar.gz
Algorithm Hash digest
SHA256 74422affda9e51c7d0b6b5a0afeb09e282515f6d00fcfdb92f74213da9d4173e
MD5 f58a4c50c73e8781babc5c33502d889f
BLAKE2b-256 e40a91aaea634338764cef334d653863af41f2040dffb5674fa3b99b6da177d0

See more details on using hashes here.

File details

Details for the file zeeq-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: zeeq-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for zeeq-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4fafefe56cab8b2dd2523fcf58183ad70678d5a7fbd051a7fe68439ad7cf6290
MD5 2aef4547e7a7d20263578cfe396f5f3f
BLAKE2b-256 8822452cc09e38e55784d9cf1856467eb30c84e3979779c3ee2c7f21d51fcd64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page