Home Reference Source
import {DaggerEngine} from 'projectq/src/meta/dagger.js'
public class | source

DaggerEngine

Extends:

BasicEngine → DaggerEngine

Stores all commands and, when done, inverts the circuit & runs it.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

commands: *[]

public

Method Summary

Public Methods
public

receive(cmdList: Command[])

Receive a list of commands and store them for later inversion.

public

run()

Run the stored circuit in reverse and check that local qubits have been deallocated.

Inherited Summary

From class BasicEngine
public
public

Return a new qubit as a list containing 1 qubit object (quantum register of size 1).

public

Allocate n qubits and return them as a quantum register, which is a list of qubit objects.

public

Deallocate a qubit (and sends the deallocation command down the pipeline).

public

Default implementation of isAvailable: Ask the next engine whether a command is available, i.e., whether it can be executed by the next engine(s).

public

Check if there is a compiler engine handling the meta tag

public
public

send(commandList: Command[])

Forward the list of commands to the next engine in the pipeline.

Public Constructors

public constructor() source

Override:

BasicEngine#constructor

Public Members

public allocateQubitIDs: * source

public commands: *[] source

public deallocateQubitIDs: * source

Public Methods

public receive(cmdList: Command[]) source

Receive a list of commands and store them for later inversion.

Override:

BasicEngine#receive

Params:

NameTypeAttributeDescription
cmdList Command[]

List of commands to temporarily store.

public run() source

Run the stored circuit in reverse and check that local qubits have been deallocated.