jaqalpaq.emulator package

class jaqalpaq.emulator.UnitarySerializedEmulator

Bases: EmulatedIndependentSubcircuitsBackend

Serialized emulator using unitary matrices

This object should be treated as an opaque symbol to be passed to run_jaqal_circuit.

jaqalpaq.emulator.run_jaqal_circuit(circuit, backend=None, force_sim=False, emulator_backend=None, **kwargs)

Execute a Jaqal Circuit using either an emulator or by communicating over IPC with another process.

Parameters:
  • circuit (Circuit) – The Jaqalpaq circuit to be run.

  • backend – The backend to perform the circuit simulation/emulation. Defaults to UnitarySerializedEmulator.

Return type:

ExecutionResult

Note

Random seed is controlled by numpy.random.seed. Consider calling

numpy.random.seed(int(time.time()))

for random behavior.

jaqalpaq.emulator.run_jaqal_file(fname, import_path=None, **kwargs)

Execute a Jaqal program in a file using either an emulator or by communicating over IPC with another process.

Parameters:
  • fname (str) – The path to a Jaqal file to execute.

  • import_path (str) – The path to perform relative Jaqal imports from. Defaults to parent directory of the file.

Return type:

ExecutionResult

Note

See run_jaqal_circuit() for additional arguments

jaqalpaq.emulator.run_jaqal_string(jaqal, import_path=None, **kwargs)

Execute a Jaqal string using either an emulator or by communicating over IPC with another process.

Parameters:
  • jaqal (str) – The literal Jaqal program text.

  • import_path (str) – The path to perform relative Jaqal imports from. Defaults to the current directory.

Return type:

ExecutionResult

Note

See run_jaqal_circuit() for additional arguments