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.4.tar.gz (7.9 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.4-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zeeq-1.1.4.tar.gz
  • Upload date:
  • Size: 7.9 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.4.tar.gz
Algorithm Hash digest
SHA256 86d6a8a47d514a48644cea8990a83f4315ad8a623b0d5a694ad655b142327d2c
MD5 0c5dfaae2b6114be71c029aa220b7307
BLAKE2b-256 206f5fe05c293ccb506f65230608fe099e47a992666173f448bbe97da2202150

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zeeq-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.1 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bd16cde01e047c330b4a7878170eefa9c1f3d5e87a75dcc9a711dd3fab70e846
MD5 992c3b9c93c0fab0fd919d1f2e3cf6cb
BLAKE2b-256 5c1708d6adb2194a49260b3cc1f7ca766fceda55bad510d52dd13de81abb129f

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