ts-quantum
Version:
TypeScript library for quantum mechanics calculations and utilities
57 lines (56 loc) • 2.65 kB
TypeScript
/**
* Core QuantumGraph implementation
*/
import { QuantumObject, IOperator } from '../core/types';
import { IQuantumGraph, MeasurementResult } from './types';
import { GraphologyAdapter } from '../../../graph-core/src/core/GraphologyAdapter';
import { IGraph, IGraphNode, IGraphEdge } from '../../../graph-core/src/core/types';
/**
* Implementation of quantum-labeled graph
*/
export declare class QuantumGraph implements IQuantumGraph {
private adapter;
private quantumNodes;
private quantumEdges;
private compositeManager;
constructor(baseGraph?: GraphologyAdapter);
setVertexQuantumObject(nodeId: string, obj: QuantumObject): void;
getVertexQuantumObject(nodeId: string): QuantumObject | undefined;
setEdgeQuantumObject(edgeId: string, obj: QuantumObject): void;
getEdgeQuantumObject(edgeId: string): QuantumObject | undefined;
hasVertexQuantumObject(nodeId: string): boolean;
hasEdgeQuantumObject(edgeId: string): boolean;
clearVertexQuantumObject(nodeId: string): void;
clearEdgeQuantumObject(edgeId: string): void;
setCompositeQuantumObject(elementIds: string[], obj: QuantumObject): void;
getCompositeQuantumObject(elementIds: string[]): QuantumObject | undefined;
applyVertexOperation(vertexIds: string[], operator: IOperator): void;
applyEdgeOperation(edgeIds: string[], operator: IOperator): void;
applyOperation(elementIds: string[], operator: IOperator): void;
measureSubsystem(vertexIds: string[], projector?: IOperator): MeasurementResult;
getGraphAdapter(): GraphologyAdapter;
get isDirected(): boolean;
get nodeCount(): number;
get edgeCount(): number;
addNode(node: IGraphNode): IGraph;
removeNode(nodeId: string): IGraph;
addEdge(edge: IGraphEdge): IGraph;
removeEdge(edgeId: string): IGraph;
getNode(nodeId: string): IGraphNode | undefined;
getEdge(edgeId: string): IGraphEdge | undefined;
getNodes(): readonly IGraphNode[];
getEdges(): readonly IGraphEdge[];
getAdjacentNodes(nodeId: string, options?: any): readonly IGraphNode[];
getConnectedEdges(nodeId: string, options?: any): readonly IGraphEdge[];
findPath(fromId: string, toId: string, options?: any): readonly any[];
toAdjacencyMatrix(weightFn?: any): any;
toLaplacianMatrix(weightFn?: any): any;
setMetadata(metadata: any): IGraph;
getMetadata(): any;
hasNode(nodeId: string): boolean;
hasEdge(edgeId: string): boolean;
areNodesAdjacent(sourceId: string, targetId: string, options?: any): boolean;
getNodeDegree(nodeId: string, options?: any): number;
clone(): IGraph;
clear(): IGraph;
}