Home Reference Source
import {Qubit} from 'projectq/src/types/qubit.js'
public class | source

Qubit

Extends:

BasicQubit → Qubit

Represents a (logical-level) qubit with a unique index provided by the MainEngine. Once the qubit goes out of scope (and is garbage-collected), it deallocates itself automatically, allowing automatic resource management.

Thus the qubit is not copyable only returns a reference to the same object.

Member Summary

Public Members
public

id: *

Method Summary

Public Methods
public

copy(): *

Non-copyable (returns reference to self).

public

Inherited Summary

From class BasicQubit
public static

copyArray(array: *): *

public
public

id: *

public

equal(other: *): boolean

Compare with other qubit (Returns true if equal id and engine).

public
public

Access the result of a previous measurement and return false / true (0 / 1)

public
public

Return string representation of this qubit.

public

weakCopy(): *

Public Members

public id: * source

Override:

BasicQubit#id

Public Methods

public copy(): * source

Non-copyable (returns reference to self). Note: To prevent problems with automatic deallocation, qubits are not copyable!

Return:

*

public deallocate() source