@@ -1439,7 +1439,7 @@ var QuantumCircuit = function(numQubits) {
14391439 params : [ "theta" ] ,
14401440 drawingInfo : {
14411441 connectors : [ "circle" , "circle" ] ,
1442- label : "X "
1442+ label : "XX "
14431443 } ,
14441444 exportInfo : {
14451445 quil : {
@@ -1460,6 +1460,9 @@ var QuantumCircuit = function(numQubits) {
14601460 //@TODO add function
14611461 func : "TODO"
14621462 } ,
1463+ qasm : {
1464+ name : "rxx"
1465+ } ,
14631466 qiskit : {
14641467 name : "rxx"
14651468 } ,
@@ -1490,7 +1493,7 @@ var QuantumCircuit = function(numQubits) {
14901493 params : [ "theta" ] ,
14911494 drawingInfo : {
14921495 connectors : [ "circle" , "circle" ] ,
1493- label : "Y "
1496+ label : "YY "
14941497 } ,
14951498 exportInfo : {
14961499 quil : {
@@ -1519,31 +1522,39 @@ var QuantumCircuit = function(numQubits) {
15191522 matrix : [ [ "cos(theta)" , 0 , 0 , "i*sin(theta)" ] , [ 0 , "cos(theta)" , "-i*sin(theta)" , 0 ] , [ 0 , "-i*sin(theta)" , "cos(theta)" , 0 ] , [ "i*sin(theta)" , 0 , 0 , "cos(theta)" ] ] ,
15201523 array : "[[np.cos(p_theta), 0, 0, 1j*np.sin(p_theta)], [0, np.cos(p_theta), -1j*np.sin(p_theta), 0], [0, -1j*np.sin(p_theta), np.cos(p_theta), 0], [1j*np.sin(p_theta), 0, 0, np.cos(p_theta)] ]" ,
15211524 params : [ "theta" ]
1525+ } ,
1526+ qasm : {
1527+ name : "ryy"
1528+ } ,
1529+ qiskit : {
1530+ name : "ryy"
15221531 }
15231532 }
15241533 } ,
1525- /*
1526- xx: {
1527- description: "Ising (XX) gate",
1528- matrix: [
1529- ["1/sqrt(2)", 0, 0, "1/sqrt(2) * (-i * pow(e, i * phi))"],
1530-
1531- [0, "1/sqrt(2)", "-i", 0],
15321534
1533- [0, "-i", "1/sqrt(2)", 0],
1534-
1535- ["1/sqrt(2) * (-i * pow(e, -i * phi))", 0, 0, "1/sqrt(2)"]
1535+ zz : {
1536+ description : "Parametrix 2-qubit rotation about ZZ" ,
1537+ matrix : [
1538+ [ "exp(-i * theta / 2)" , 0 , 0 , 0 ] ,
1539+ [ 0 , "exp(i * theta / 2)" , 0 , 0 ] ,
1540+ [ 0 , 0 , "exp(i * theta / 2)" , 0 ] ,
1541+ [ 0 , 0 , 0 , "exp(-i * theta / 2)" ]
15361542 ] ,
1537- params: ["phi "],
1543+ params : [ "theta " ] ,
15381544 drawingInfo : {
1539- connectors: ["not ","not "],
1540- label: "XX "
1545+ connectors : [ "circle " , "circle " ] ,
1546+ label : "ZZ "
15411547 } ,
15421548 exportInfo : {
1543-
1549+ qasm : {
1550+ name : "rzz"
1551+ } ,
1552+ qiskit : {
1553+ name : "rzz"
1554+ }
15441555 }
15451556 } ,
1546- */
1557+
15471558 cr2 : {
15481559 description : "Controlled PI/2 rotation over Z-axis" ,
15491560 matrix : [
@@ -6892,14 +6903,6 @@ QuantumCircuit.prototype.exportToSVG = function(options) {
68926903 if ( connector == "x" ) {
68936904 connector = "box" ;
68946905 }
6895-
6896- if ( gateName == "ms" ) {
6897- gateLabel = "XX" ;
6898- }
6899-
6900- if ( gateName == "yy" ) {
6901- gateLabel = "YY" ;
6902- }
69036906 }
69046907
69056908 var uniqStr = gateLabel + "|" + connector ;
@@ -8024,10 +8027,11 @@ QuantumCircuit.prototype.exportToQASM = function(options, exportAsGateName, circ
80248027 }
80258028
80268029 if ( ( ! qasmReplacement && ! qasmEquivalent ) || compatibilityMode ) {
8027- var gateName = compatibilityMode ? gate . name : qasmName ;
8028-
8030+ var gateName = gate . name ;
80298031 var gateParams = gate . options && gate . options . params ? gate . options . params : { } ;
8030- qasm += gateName ;
8032+
8033+ qasm += compatibilityMode ? gate . name : qasmName ;
8034+
80318035 if ( gateParams ) {
80328036 var gateDef = this . basicGates [ gateName ] ;
80338037 if ( ! gateDef ) {
0 commit comments