|
@@ -48,7 +48,7 @@ editor.addQubitAtPoint = function(point) { |
|
|
gui.serverMessage("Node " + new_node +" already exists."); |
|
|
gui.serverMessage("Node " + new_node +" already exists."); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
websocket.edit({action:"create", name:new_node, position: point}); |
|
|
|
|
|
|
|
|
api.edit({action:"create", name:new_node, position: point}); |
|
|
editor.focus(new_node); |
|
|
editor.focus(new_node); |
|
|
gui.serverMessage("Created node " + new_node +"."); |
|
|
gui.serverMessage("Created node " + new_node +"."); |
|
|
}; |
|
|
}; |
|
@@ -77,7 +77,7 @@ editor.onShiftClick = function() { |
|
|
if (editor.selection === undefined){ return; } |
|
|
if (editor.selection === undefined){ return; } |
|
|
if (found === editor.selection){ return; } |
|
|
if (found === editor.selection){ return; } |
|
|
//abj.act_cz(found, editor.selection); |
|
|
//abj.act_cz(found, editor.selection); |
|
|
websocket.edit({action:"cz", start:found, end:editor.selection}); |
|
|
|
|
|
|
|
|
api.edit({action:"cz", start:found, end:editor.selection}); |
|
|
gui.serverMessage("Acted CZ between " + found + " & " + editor.selection + "."); |
|
|
gui.serverMessage("Acted CZ between " + found + " & " + editor.selection + "."); |
|
|
editor.focus(found); |
|
|
editor.focus(found); |
|
|
}; |
|
|
}; |
|
@@ -87,7 +87,7 @@ editor.onCtrlClick = function() { |
|
|
if (found === undefined){ return; } |
|
|
if (found === undefined){ return; } |
|
|
if (editor.selection === undefined){ return; } |
|
|
if (editor.selection === undefined){ return; } |
|
|
editor.focus(found); |
|
|
editor.focus(found); |
|
|
websocket.edit({action:"hadamard", node:found}); |
|
|
|
|
|
|
|
|
api.edit({action:"hadamard", node:found}); |
|
|
gui.serverMessage("Acted H on node " + found + "."); |
|
|
gui.serverMessage("Acted H on node " + found + "."); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@@ -144,7 +144,7 @@ editor.findNodeOnRay = function(ray) { |
|
|
|
|
|
|
|
|
editor.deleteNode = function() { |
|
|
editor.deleteNode = function() { |
|
|
if (editor.selection === undefined){ return; } |
|
|
if (editor.selection === undefined){ return; } |
|
|
websocket.edit({action:"delete", node:editor.selection}); |
|
|
|
|
|
|
|
|
api.edit({action:"delete", node:editor.selection}); |
|
|
gui.serverMessage("Deleted node " + editor.selection + "."); |
|
|
gui.serverMessage("Deleted node " + editor.selection + "."); |
|
|
editor.selection = undefined; |
|
|
editor.selection = undefined; |
|
|
node_data.className = "hidden"; |
|
|
node_data.className = "hidden"; |
|
@@ -154,37 +154,37 @@ editor.deleteNode = function() { |
|
|
|
|
|
|
|
|
editor.hadamard = function() { |
|
|
editor.hadamard = function() { |
|
|
if (editor.selection === undefined){ return; } |
|
|
if (editor.selection === undefined){ return; } |
|
|
websocket.edit({action:"hadamard", node:editor.selection}); |
|
|
|
|
|
|
|
|
api.edit({action:"hadamard", node:editor.selection}); |
|
|
gui.serverMessage("Acted Hadamard on node " + editor.selection + "."); |
|
|
gui.serverMessage("Acted Hadamard on node " + editor.selection + "."); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
editor.phase = function() { |
|
|
editor.phase = function() { |
|
|
if (editor.selection === undefined){ return; } |
|
|
if (editor.selection === undefined){ return; } |
|
|
websocket.edit({action:"phase", node:editor.selection}); |
|
|
|
|
|
|
|
|
api.edit({action:"phase", node:editor.selection}); |
|
|
gui.serverMessage("Acted phase on node " + editor.selection + "."); |
|
|
gui.serverMessage("Acted phase on node " + editor.selection + "."); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
editor.measureX = function() { |
|
|
editor.measureX = function() { |
|
|
if (editor.selection === undefined){ return; } |
|
|
if (editor.selection === undefined){ return; } |
|
|
websocket.edit({action:"measure", node:editor.selection, basis:"x"}); |
|
|
|
|
|
|
|
|
api.edit({action:"measure", node:editor.selection, basis:"x"}); |
|
|
gui.serverMessage("Measured node " + editor.selection + " in X."); |
|
|
gui.serverMessage("Measured node " + editor.selection + " in X."); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
editor.measureY = function() { |
|
|
editor.measureY = function() { |
|
|
if (editor.selection === undefined){ return; } |
|
|
if (editor.selection === undefined){ return; } |
|
|
websocket.edit({action:"measure", node:editor.selection, basis:"y"}); |
|
|
|
|
|
|
|
|
api.edit({action:"measure", node:editor.selection, basis:"y"}); |
|
|
gui.serverMessage("Measured node " + editor.selection + " in Y."); |
|
|
gui.serverMessage("Measured node " + editor.selection + " in Y."); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
editor.measureZ = function() { |
|
|
editor.measureZ = function() { |
|
|
if (editor.selection === undefined){ return; } |
|
|
if (editor.selection === undefined){ return; } |
|
|
websocket.edit({action:"measure", node:editor.selection, basis:"z"}); |
|
|
|
|
|
|
|
|
api.edit({action:"measure", node:editor.selection, basis:"z"}); |
|
|
gui.serverMessage("Measured node " + editor.selection + " in z."); |
|
|
gui.serverMessage("Measured node " + editor.selection + " in z."); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
editor.localComplementation = function() { |
|
|
editor.localComplementation = function() { |
|
|
if (editor.selection === undefined){ return; } |
|
|
if (editor.selection === undefined){ return; } |
|
|
websocket.edit({action:"localcomplementation", node:editor.selection}); |
|
|
|
|
|
|
|
|
api.edit({action:"localcomplementation", node:editor.selection}); |
|
|
abj.local_complementation(editor.selection); |
|
|
abj.local_complementation(editor.selection); |
|
|
gui.serverMessage("Inverted neighbourhood of " + editor.selection + "."); |
|
|
gui.serverMessage("Inverted neighbourhood of " + editor.selection + "."); |
|
|
}; |
|
|
}; |