Skip to content

zanwenfu/Quantum-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Quantum Compiler

Features

  1. Load and Modify Commands
    User commands are loaded from the file everything.txt, which contains FPGA and DDS sequences. These commands are parsed and executed on FPGA and DDS systems.

  2. Multi-threading
    The experiment runs in a separate thread, allowing users to control the process (pause, resume, abort) without interrupting the main flow of the program.

  3. Live Data Plotting
    Real-time plotting of histograms and sequence data is achieved using matplotlib. Data is continuously fetched from a queue and dynamically displayed.

  4. Keyboard Shortcuts
    The following shortcuts can be used to control the experiment:

    • P: Pause the execution.
    • R: Resume the execution.
    • ESC: Abort the execution.

Preparations

Preparing the FPGA Sequence

  1. Run the following command to open the graphical user interface (GUI):
    python chapter_gui.py
  2. Load or save the chapter as xxx.dat.

Preparing the parse_command.py

1. Prepare dds_defaults.csv

This file contains the default values for all DDS devices. The DDS devices are initialized with values from dds_defaults.csv.

2. Prepare everything.txt

2.1 DDS Settings

This section allows users to change the default DDS values for each experiment without modifying the dds_defaults.csv file.

  • Format:
    <DDS serial number>, <parameter>, <value>

    • <DDS serial number>: The name of the DDS to be modified.
    • <parameter>: The parameter (column) to modify, which should correspond to the column name in dds_defaults.csv.
    • <value>: The new value for the parameter.

2.2 Number of Repetitions

Defines the number of repetitions for each experiment. If left empty, the number of repetitions defaults to 100.

  • Format: Integer

2.3 FPGA Sequences

This section lists the names of gates or chapters that will be loaded into the FPGA sequence.

  • Format: Chapter name followed by a newline (The sequence order is from top to bottom).

2.4 Scan Type

Specifies the type of scan to be performed (either delayscan or freqscan).

  • Format for delayscan:
    <scan type>, <Gate name>, <row>, <start value>, <stop value>, <step increment>

    • <scan type>: delayscan
    • <Gate name>: The name of the chapter where the delay value will be changed.
    • <row>: The row number in which the delay value will be modified (1 for the first row, 2 for the second, and so on).
    • <start value>: The initial delay value.
    • <stop value>: The final delay value.
    • <step increment>: The step size for each increment.

    Example:
    delayscan, Measurement, 1, 0, 200, 5

  • Format for freqscan:
    <scan type>, <DDS serial number>, <parameter>, <start value>, <stop value>, <step increment>

    • <scan type>: freqscan
    • <DDS serial number>: The name of the DDS whose frequency will be modified.
    • <parameter>: The frequency-related column to modify (corresponding to the column name in dds_defaults.csv).
    • <start value>: The initial frequency value.
    • <stop value>: The final frequency value.
    • <step increment>: The step size for each increment.

How to Run

  1. Start a scan by running the following command:
    python parse_command.py
  2. The resulting histogram will be saved as .dat files in either the delayscan or freqscan directories.
  3. To view the plot, run the following command:
    python plot.py

About

This is a quantum compiler built on trapped-ion computers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages