Home Reference Source
import BasicMapperEngine from 'projectq/src/cengines/basicmapper.js'
public class | source

BasicMapperEngine

Extends:

BasicEngine → BasicMapperEngine

Defines the parent class from which all mappers should be derived.

There is only one engine currently allowed to be derived from BasicMapperEngine. This allows the simulator to automatically translate logical qubit ids to mapped ids.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get
public set
Private Members
private

Method Summary

Public Methods
public

Send this Command using the mapped qubit ids of this.current_mapping.

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 get currentMapping: * source

public set currentMapping source

Private Members

private _currentMapping: * source

Public Methods

public sendCMDWithMappedIDs(cmd: Command) source

Send this Command using the mapped qubit ids of this.current_mapping.

If it is a Measurement gate, then it adds a LogicalQubitID tag.

Params:

NameTypeAttributeDescription
cmd Command

Command object with logical qubit ids.