quantum_nodes.demo_addon.backend

Modules

quantum_nodes.demo_addon.backend.circuit_manager

class quantum_nodes.demo_addon.backend.circuit_manager.CircuitManager(nb_qubits, mg)

Bases: object

Manage a quantum circuit.

popGate(q_index)
pushGate(q_index, gate)
reset()

quantum_nodes.demo_addon.backend.demo_node_tree_utils

quantum_nodes.demo_addon.backend.demo_node_tree_utils.generateCircuit(context, demo_id, circuit_id)
quantum_nodes.demo_addon.backend.demo_node_tree_utils.generateMainNodeTree(context, main_tree_id, obj)
quantum_nodes.demo_addon.backend.demo_node_tree_utils.generateMaxValue(context, demo_id)
quantum_nodes.demo_addon.backend.demo_node_tree_utils.generateMeshData(context, demo_id)
quantum_nodes.demo_addon.backend.demo_node_tree_utils.generateMultiplyAll(context, demo_id)
quantum_nodes.demo_addon.backend.demo_node_tree_utils.generateNegative(context, demo_id)

quantum_nodes.demo_addon.backend.gate

class quantum_nodes.demo_addon.backend.gate.Gate(t, n, i, loc, inp=None, out=None)

Bases: object

Represent a gate node in a quantum circuit.

quantum_nodes.demo_addon.backend.gate_nodes_manager

class quantum_nodes.demo_addon.backend.gate_nodes_manager.GateNodesManager

Bases: object

Manage gates in a quantum circuit built with nodes.

classmethod addGate(new_gate, circuit_tree, q_index)

Add a new gate in the given circuit node tree.

classmethod getExistingGate(circuit_tree, gate_type, q_index, qubit_data)

Return the gate if it already exists.

classmethod qubitIndexInGate(q_index, node)

Return True if the q_index is a value of one of the sockets.

classmethod removeGate(gate_node, circuit_tree)

Remove the given gate node. Create a new link between the input and output of the deleted node.

Remove the link between the given input and output.

quantum_nodes.demo_addon.backend.gates_factory

class quantum_nodes.demo_addon.backend.gates_factory.GatesFactory(start_left, spacing, demo_id)

Bases: object

Generate new gates.

createGate(gate_name, gate_type, gate_index, circuit_tree)

Store all the useful information to add a new node to the circuit node tree.

Also moves the output nodes to the right if more space is needed.

getExistingGates(circuit_tree)

Return all the existing gate nodes in the circuit.

quantum_nodes.demo_addon.backend.node_tree_manager

class quantum_nodes.demo_addon.backend.node_tree_manager.NodeTreeManager

Bases: object

Manage a node tree generated from this add-on.

generateNodeTree(obj)

Generate the demo node trees.

classmethod getModification(last_circuits, new_circuits)

Return the information about the modification done on the circuits.

Returns: action, gate_type, (circuit name, qubit index, gate index).

removeAllTrees()

Remove all the demo node trees.

resetAllGates()

Reset all the gate nodes in the node trees (for each circuit).

update(new_circuits)

Update the circuit node trees.

If "ADD" :

Searches for a potential existing gate to insert the new one. If not found, then creates a new node.

If "DEL" :

Retrieves the node where the gate is and removes the socket. If the node isn't used anymore, deletes it.

updateTarget(obj)

Update the target of the quantum circuits.

quantum_nodes.demo_addon.backend.quantum_nodes_demo_manager

class quantum_nodes.demo_addon.backend.quantum_nodes_demo_manager.QuantumNodesDEMOManager

Bases: object

Manage of the demo panel.

getSelectedCircuit()

Return the circuit corresponding the selected axis in the UI. It returns a CircuitManager, not a list.

initializeDemoNodeTree()

Build the demo node tree and links the target to the tree.

removeAll()
resetCircuits()

Reset circuits and the corresponding node trees.

setNewCircuits(obj)

Set the new circuit. The size depends on the number of vertices of the target.

setNewTarget(new_target)

Set the new target and resets everything (circuits in the UI + node trees).

updateNodeTree()

Update the node tree so that it corresponds to the represented circuits in the UI.