qsim::CircuitQsimParser

#include <circuit_qsim_parser.h>

Parser for the (deprecated) qsim file input format.

Summary

The primary supported interface for designing circuits to simulate with qsim is Cirq, which relies on the Python-based qsimcirq interface. For C++ applications, Cirq gates can be explicitly constructed in code.

Public static functions

FromFile(unsigned maxtime, const std::string & file, Circuit< GateQSim< fp_type >> & circuit)
bool
Parses the given file into a Circuit object, following the rules defined in "docs/input_format.md".
FromStream(unsigned maxtime, const std::string & provider, Stream & fs, Circuit< GateQSim< fp_type >> & circuit)
bool
Parses the given input stream into a Circuit object, following the rules defined in "docs/input_format.md".

Public static functions

FromFile

bool FromFile(
  unsigned maxtime,
  const std::string & file,
  Circuit< GateQSim< fp_type >> & circuit
)

Parses the given file into a Circuit object, following the rules defined in "docs/input_format.md".

Details
Parameters
maxtime
Maximum gate "time" to read operations for (inclusive).
file
The name of the file to read the circuit from.
circuit
Output circuit object. If parsing is successful, this will contain the circuit defined in 'file'.
Returns
True if parsing succeeds; false otherwise.

FromStream

bool FromStream(
  unsigned maxtime,
  const std::string & provider,
  Stream & fs,
  Circuit< GateQSim< fp_type >> & circuit
)

Parses the given input stream into a Circuit object, following the rules defined in "docs/input_format.md".

Details
Parameters
maxtime
Maximum gate "time" to read operations for (inclusive).
provider
Circuit source; only used for error reporting.
fs
The stream to read the circuit from.
circuit
Output circuit object. If parsing is successful, this will contain the circuit defined in 'fs'.
Returns
True if parsing succeeds; false otherwise.