UNPKG

quantum-circuit

Version:
1 lines 1.98 MB
!function(f){"object"==typeof exports&&"undefined"!=typeof module?module.exports=f():"function"==typeof define&&define.amd?define([],f):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).QuantumCircuit=f()}(function(){return function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({1:[function(require,module,exports){function ErrorListener(errors){return antlr4.error.ErrorListener.call(this),this.errors=errors,this}var antlr4=require("antlr4/index"),QASMLexer=require("./QASMLexer"),QASMParser=require("./QASMParser").QASMParser,QASMListener=require("./QASMListener").QASMListener;((ErrorListener.prototype=Object.create(antlr4.error.ErrorListener.prototype)).constructor=ErrorListener).prototype.syntaxError=function(rec,sym,line,col,msg,e){this.errors.push({line:line,col:col,msg:msg})};function QCQASMListener(circuit,compatibilityMode){return this.circuit=circuit,this.qregMap={},this.condition={},this.compatibilityMode=compatibilityMode,QASMListener.call(this),this}((QCQASMListener.prototype=Object.create(QASMListener.prototype)).constructor=QCQASMListener).prototype.numQbit=function(){var num=0;for(var reg in this.qregMap)num+=this.qregMap[reg];return num},QCQASMListener.prototype.qregBase=function(qreg){var base=0;for(var reg in this.qregMap){if(reg==qreg)return base;base+=this.qregMap[reg]}return base},QCQASMListener.prototype.qregLen=function(reg){return this.qregMap[reg]||0},QCQASMListener.prototype.enterMainprog=function(ctx){},QCQASMListener.prototype.exitMainprog=function(ctx){},QCQASMListener.prototype.enterStatement=function(ctx){var gatedecl,params,ccount,customGate,customGateName,customGateRegs,goplist,self=this,name=ctx.getChildCount()?ctx.getChild(0).getText():"";if("if"==name&&(this.condition={creg:ctx.ID().getText(),value:parseInt(ctx.INT().getText())}),"barrier"==name){var idlist=ctx.anylist()?ctx.anylist().idlist():null,mixedlist=ctx.anylist()?ctx.anylist().mixedlist():null;if(idlist){for(var wires=[],regCount=idlist.ID().length,regIndex=0;regIndex<regCount;regIndex++)for(var regName=idlist.ID()[regIndex].getText(),numBits=self.qregLen(regName),bit=0;bit<numBits;bit++){var wire=bit+self.qregBase(regName);wires.push(wire)}var destCol=self.circuit.lastNonEmptyPlace(wires,!1);destCol+=1,wires.map(function(destWire){self.circuit.addGate(name,destCol,destWire)})}if(mixedlist&&mixedlist.ID().length==mixedlist.INT().length){for(var args=[],count=mixedlist.ID().length,i=0;i<count;i++)args.push({reg:mixedlist.ID()[i].getText(),bit:parseInt(mixedlist.INT()[i].getText())});wires=[];args.map(function(a){wires.push(a.bit+self.qregBase(a.reg))}),self.circuit.addGate(name,-1,wires,{})}}ctx.gatedecl()&&(args=[],params=[],2<(ccount=(gatedecl=ctx.gatedecl()).getChildCount())&&gatedecl.getChild(2).ID?args=gatedecl.getChild(2).ID():(3<ccount&&gatedecl.getChild(3).ID&&(params=gatedecl.getChild(3).ID()),5<ccount&&gatedecl.getChild(5).ID&&(args=gatedecl.getChild(5).ID())),customGate=new(Object.getPrototypeOf(this.circuit).constructor)(args.length),customGateName=gatedecl.ID().getText(),customGateRegs=[],args.map(function(reg){customGateRegs.push(reg.getText())}),params.map(function(par){var parName=par.getText();customGate.params.push(parName)}),ctx.goplist()&&(goplist=ctx.goplist()).children.forEach(function(child,childIndex){if(child instanceof QASMParser.UopContext){var uop=child;if(gateName=uop.ID()?uop.ID().getText():""){var idlist=uop.anylist()?uop.anylist().idlist():null,explist=(uop.anylist()&&uop.anylist().mixedlist(),uop.explist());switch(gateName){case"CX":gateName="cx";break;case"U":gateName="u3"}if(!self.circuit.basicGates[gateName]&&!self.circuit.customGates[gateName])for(var tmpName in self.circuit.basicGates){var tmpDef=self.circuit.basicGates[tmpName];if(tmpDef.exportInfo&&tmpDef.exportInfo.qasm&&tmpDef.exportInfo.qasm.name&&tmpDef.exportInfo.qasm.name==gateName){gateName=tmpName;break}if(tmpDef.exportInfo&&tmpDef.exportInfo.qiskit&&tmpDef.exportInfo.qiskit.name&&tmpDef.exportInfo.qiskit.name==gateName){gateName=tmpName;break}}var paramList,paramDef,gateDef,params={};explist&&explist.exp()&&((gateDef=(gateDef=self.circuit.basicGates[gateName])||self.circuit.customGates[gateName])&&(paramList=explist.exp(),paramDef=gateDef.params||[],paramList.map(function(paramItem,paramIndex){var paramValue=paramItem.getText(),paramName=paramIndex<=paramDef.length?paramDef[paramIndex]:"";paramName&&(params[paramName]=paramValue)})));var options={params:params},wires=[];if(idlist)for(var count=idlist.ID().length,i=0;i<count;i++)wires.push(customGateRegs.indexOf(idlist.ID()[i].getText()));var external=self.circuit.customGates[gateName];external&&customGate.registerGate(gateName,JSON.parse(JSON.stringify(external))),customGate.addGate(gateName,-1,wires,options)}}else{var gateName;if(gateName=child.getText?child.getText():"")switch(gateName){case"barrier":if(goplist.children.length>childIndex+1&&(idlist=goplist.children[childIndex+1])&&idlist.ID){wires=[];if(idlist){for(count=idlist.ID().length,i=0;i<count;i++)wires.push(customGateRegs.indexOf(idlist.ID()[i].getText()));options={params:{}};customGate.addGate(gateName,-1,wires,options)}}}}}),this.circuit.registerGate(customGateName,customGate.save(!1)))},QCQASMListener.prototype.exitStatement=function(ctx){},QCQASMListener.prototype.enterVersion=function(ctx){},QCQASMListener.prototype.exitVersion=function(ctx){},QCQASMListener.prototype.enterDecl=function(ctx){switch(ctx.getChild(0).getText()){case"qreg":this.qregMap[ctx.getChild(1).getText()]=parseInt(ctx.getChild(3).getText());break;case"creg":this.circuit.createCreg(ctx.getChild(1).getText(),parseInt(ctx.getChild(3).getText()))}},QCQASMListener.prototype.exitDecl=function(ctx){},QCQASMListener.prototype.enterGatedecl=function(ctx){},QCQASMListener.prototype.exitGatedecl=function(ctx){},QCQASMListener.prototype.enterGoplist=function(ctx){},QCQASMListener.prototype.exitGoplist=function(ctx){},QCQASMListener.prototype.enterQop=function(ctx){var self=this,condition=JSON.parse(JSON.stringify(this.condition));this.condition={};var name=ctx.getChildCount()?ctx.getChild(0).getText():"";if("reset"==name){for(var qreg="",qbit=-1,count=ctx.argument().length,i=0;i<count;i++){var arg=ctx.argument()[i];0==i&&(qreg=arg.ID().getText(),qbit=arg.INT()?parseInt(arg.INT().getText()):-1)}if(qreg){var numBits=self.qregLen(qreg);if(qbit<0)for(var x=0;x<numBits;x++)self.circuit.addGate("reset",-1,x+self.qregBase(qreg),{condition:condition||{}});else self.circuit.addGate("reset",-1,qbit+self.qregBase(qreg),{condition:condition||{}})}}if("measure"==name){for(var qreg="",qbit=-1,creg="",cbit=-1,count=ctx.argument().length,i=0;i<count;i++){arg=ctx.argument()[i];0==i&&(qreg=arg.ID().getText(),qbit=arg.INT()?parseInt(arg.INT().getText()):-1),1==i&&(creg=arg.ID().getText(),cbit=arg.INT()?parseInt(arg.INT().getText()):-1)}if(qreg&&creg){numBits=self.qregLen(qreg);if(qbit<0&&cbit<0)for(x=0;x<numBits;x++)self.circuit.addGate("measure",-1,x+self.qregBase(qreg),{creg:{name:creg,bit:x},condition:condition||{}});else if(0<=qbit&&0<=cbit)self.circuit.addGate("measure",-1,qbit+self.qregBase(qreg),{creg:{name:creg,bit:cbit},condition:condition||{}});else if(0<=qbit&&cbit<0)for(x=0;x<numBits;x++)self.circuit.addGate("measure",-1,qbit+self.qregBase(qreg),{creg:{name:creg,bit:x},condition:condition||{}});else for(x=0;x<numBits;x++)self.circuit.addGate("measure",-1,x+self.qregBase(qreg),{creg:{name:creg,bit:cbit},condition:condition||{}})}}var uop=ctx.uop();if(uop&&uop.ID()){var gateName=uop.ID().getText(),idlist=uop.anylist()?uop.anylist().idlist():null,mixedlist=uop.anylist()?uop.anylist().mixedlist():null,explist=uop.explist();switch(gateName){case"CX":gateName="cx";break;case"U":gateName="u3"}if(!self.circuit.basicGates[gateName]&&!self.circuit.customGates[gateName])for(var tmpName in self.circuit.basicGates){var tmpDef=self.circuit.basicGates[tmpName];if(tmpDef.exportInfo&&tmpDef.exportInfo.qasm&&tmpDef.exportInfo.qasm.name&&tmpDef.exportInfo.qasm.name==gateName){gateName=tmpName;break}if(tmpDef.exportInfo&&tmpDef.exportInfo.qiskit&&tmpDef.exportInfo.qiskit.name&&tmpDef.exportInfo.qiskit.name==gateName){gateName=tmpName;break}}var paramList,paramDef,gateDef,params={};explist&&explist.exp()&&((gateDef=(gateDef=self.circuit.basicGates[gateName])||self.circuit.customGates[gateName])&&(paramList=explist.exp(),paramDef=gateDef.params||[],paramList.map(function(paramItem,paramIndex){var paramValue=paramItem.getText(),paramName=paramIndex<=paramDef.length?paramDef[paramIndex]:"";paramName&&(params[paramName]=paramValue)})));var options={params:params,condition:condition||{}};if(idlist)for(numBits=self.qregLen(idlist.ID()[0].getText()),x=0;x<numBits;x++){for(var args=[],count=idlist.ID().length,i=0;i<count;i++)args.push({reg:idlist.ID()[i].getText(),bit:x});var wires=[];args.map(function(a){wires.push(a.bit+self.qregBase(a.reg))}),self.circuit.addGate(gateName,-1,wires,options)}if(mixedlist&&mixedlist.ID().length==mixedlist.INT().length){for(args=[],count=mixedlist.ID().length,i=0;i<count;i++)args.push({reg:mixedlist.ID()[i].getText(),bit:parseInt(mixedlist.INT()[i].getText())});wires=[];args.map(function(a){wires.push(a.bit+self.qregBase(a.reg))}),self.circuit.addGate(gateName,-1,wires,options)}}},QCQASMListener.prototype.exitQop=function(ctx){},QCQASMListener.prototype.enterUop=function(ctx){},QCQASMListener.prototype.exitUop=function(ctx){},QCQASMListener.prototype.enterAnylist=function(ctx){},QCQASMListener.prototype.exitAnylist=function(ctx){},QCQASMListener.prototype.enterIdlist=function(ctx){},QCQASMListener.prototype.exitIdlist=function(ctx){},QCQASMListener.prototype.enterMixedlist=function(ctx){},QCQASMListener.prototype.exitMixedlist=function(ctx){},QCQASMListener.prototype.enterArgument=function(ctx){},QCQASMListener.prototype.exitArgument=function(ctx){},QCQASMListener.prototype.enterExplist=function(ctx){},QCQASMListener.prototype.exitExplist=function(ctx){},QCQASMListener.prototype.enterExp=function(ctx){},QCQASMListener.prototype.exitExp=function(ctx){},QCQASMListener.prototype.enterUnaryop=function(ctx){},QCQASMListener.prototype.exitUnaryop=function(ctx){},module.exports=function(circuit,input,errorCallback,compatibilityMode){var chars=new antlr4.InputStream(input),lexer=new QASMLexer.QASMLexer(chars),tokens=new antlr4.CommonTokenStream(lexer),parser=new QASMParser(tokens);parser.buildParseTrees=!0,parser.removeErrorListeners();var errors=[],errorListener=new ErrorListener(errors);parser.addErrorListener(errorListener);var tree=parser.mainprog(),QASM=new QCQASMListener(circuit,compatibilityMode);antlr4.tree.ParseTreeWalker.DEFAULT.walk(QASM,tree),errorCallback&&errorCallback(errors)}},{"./QASMLexer":2,"./QASMListener":3,"./QASMParser":4,"antlr4/index":47}],2:[function(require,module,exports){var antlr4=require("antlr4/index"),serializedATN=["\x03\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964","\x02-\u0124\b\x01\x04\x02\t\x02\x04\x03\t\x03\x04","\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07\t","\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04","\f\t\f\x04\r\t\r\x04\x0e\t\x0e\x04\x0f\t\x0f\x04\x10","\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04\x13\t\x13","\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17","\t\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1a\t\x1a","\x04\x1b\t\x1b\x04\x1c\t\x1c\x04\x1d\t\x1d\x04\x1e",'\t\x1e\x04\x1f\t\x1f\x04 \t \x04!\t!\x04"\t"\x04#',"\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t)\x04","*\t*\x04+\t+\x04,\t,\x03\x02\x03\x02\x03\x03\x03\x03","\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x04","\x03\x04\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07","\x03\x07\x03\x07\x03\b\x03\b\x03\b\x03\t\x03\t\x03","\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\n\x03\n\x03\n\x03","\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\v\x03\v\x03","\v\x03\v\x03\v\x03\v\x03\v\x03\v\x03","\f\x03\f\x03\f\x03\f\x03\f\x03\r\x03\r\x03\x0e\x03","\x0e\x03\x0f\x03\x0f\x03\x0f\x03\x0f\x03\x0f\x03","\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x11\x03","\x11\x03\x12\x03\x12\x03\x12\x03\x12\x03\x12\x03","\x12\x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03","\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03","\x15\x03\x15\x03\x16\x03\x16\x03\x16\x03\x17\x03","\x17\x03\x18\x03\x18\x03\x19\x03\x19\x03\x1a\x03","\x1a\x03\x1b\x03\x1b\x03\x1c\x03\x1c\x03\x1d\x03","\x1d\x03\x1d\x03\x1d\x03\x1e\x03\x1e\x03\x1e\x03","\x1e\x03\x1f\x03\x1f\x03\x1f\x03\x1f\x03 \x03",' \x03 \x03 \x03!\x03!\x03!\x03"\x03"\x03"\x03"','\x03"\x03#\x03#\x03#\x03$\x03$\x03$\x03$\x03$\x03',"$\x03$\x05$\xe1\n$\x03%\x03%\x03%\x06%\xe6\n%\r%\x0e","%\xe7\x03&\x03&\x03&\x06&\xed\n&\r&\x0e&\xee\x03'","\x06'\xf2\n'\r'\x0e'\xf3\x03(\x03(\x07(\xf8\n(\f","(\x0e(\xfb\v(\x03)\x06)\xfe\n)\r)\x0e)\xff\x03)","\x03)\x03*\x03*\x06*\u0106\n*\r*\x0e*\u0107\x03*\x03*","\x03+\x03+\x03+\x03+\x07+\u0110\n+\f+\x0e+\u0113\v+","\x03+\x03+\x03+\x03+\x03+\x03,\x03,\x03,\x03,\x07",",\u011e\n,\f,\x0e,\u0121\v,\x03,\x03,\x03\u0111\x02-\x03","\x03\x05\x04\x07\x05\t\x06\v\x07\r\b\x0f\t\x11","\n\x13\v\x15\f\x17\r\x19\x0e\x1b\x0f\x1d\x10\x1f","\x11!\x12#\x13%\x14'\x15)\x16+\x17-\x18/\x191\x1a","3\x1b5\x1c7\x1d9\x1e;\x1f= ?!A\"C#E$G%I&K'M(O)Q*S+U,W-\x03","\x02\n\x03\x022;\x04\x02GGgg\x04\x02--//\x03\x02c",'|\x06\x022;C\\aac|\x05\x02\v\f\x0e\x0f""\x07\x02',"/02;C\\aac|\x04\x02\f\f\x0f\x0f\x02\u012d\x02\x03\x03","\x02\x02\x02\x02\x05\x03\x02\x02\x02\x02\x07\x03","\x02\x02\x02\x02\t\x03\x02\x02\x02\x02\v\x03","\x02\x02\x02\x02\r\x03\x02\x02\x02\x02\x0f\x03","\x02\x02\x02\x02\x11\x03\x02\x02\x02\x02\x13\x03","\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03","\x02\x02\x02\x02\x19\x03\x02\x02\x02\x02\x1b\x03","\x02\x02\x02\x02\x1d\x03\x02\x02\x02\x02\x1f\x03","\x02\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02","\x02\x02\x02%\x03\x02\x02\x02\x02'\x03\x02\x02","\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02","\x02-\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x02","1\x03\x02\x02\x02\x023\x03\x02\x02\x02\x025\x03","\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02","\x02\x02\x02;\x03\x02\x02\x02\x02=\x03\x02\x02","\x02\x02?\x03\x02\x02\x02\x02A\x03\x02\x02\x02","\x02C\x03\x02\x02\x02\x02E\x03\x02\x02\x02\x02","G\x03\x02\x02\x02\x02I\x03\x02\x02\x02\x02K\x03","\x02\x02\x02\x02M\x03\x02\x02\x02\x02O\x03\x02","\x02\x02\x02Q\x03\x02\x02\x02\x02S\x03\x02\x02","\x02\x02U\x03\x02\x02\x02\x02W\x03\x02\x02\x02","\x03Y\x03\x02\x02\x02\x05[\x03\x02\x02\x02\x07","b\x03\x02\x02\x02\td\x03\x02\x02\x02\vf\x03\x02","\x02\x02\rh\x03\x02\x02\x02\x0fk\x03\x02\x02\x02","\x11n\x03\x02\x02\x02\x13v\x03\x02\x02\x02\x15","\x7f\x03\x02\x02\x02\x17\x87\x03\x02\x02\x02\x19","\x8c\x03\x02\x02\x02\x1b\x8e\x03\x02\x02\x02\x1d","\x90\x03\x02\x02\x02\x1f\x95\x03\x02\x02\x02!","\x9a\x03\x02\x02\x02#\x9c\x03\x02\x02\x02%\xa4","\x03\x02\x02\x02'\xa7\x03\x02\x02\x02)\xad\x03","\x02\x02\x02+\xaf\x03\x02\x02\x02-\xb2\x03\x02","\x02\x02/\xb4\x03\x02\x02\x021\xb6\x03\x02\x02","\x023\xb8\x03\x02\x02\x025\xba\x03\x02\x02\x02","7\xbc\x03\x02\x02\x029\xbe\x03\x02\x02\x02;\xc2","\x03\x02\x02\x02=\xc6\x03\x02\x02\x02?\xca\x03","\x02\x02\x02A\xce\x03\x02\x02\x02C\xd1\x03\x02","\x02\x02E\xd6\x03\x02\x02\x02G\xe0\x03\x02\x02","\x02I\xe2\x03\x02\x02\x02K\xe9\x03\x02\x02\x02","M\xf1\x03\x02\x02\x02O\xf5\x03\x02\x02\x02Q\xfd","\x03\x02\x02\x02S\u0103\x03\x02\x02\x02U\u010b\x03","\x02\x02\x02W\u0119\x03\x02\x02\x02YZ\x07\x7f\x02","\x02Z\x04\x03\x02\x02\x02[\\\x07q\x02\x02\\]\x07","r\x02\x02]^\x07c\x02\x02^_\x07s\x02\x02_`\x07w\x02","\x02`a\x07g\x02\x02a\x06\x03\x02\x02\x02bc\x07=","\x02\x02c\b\x03\x02\x02\x02de\x07*\x02\x02e\n\x03","\x02\x02\x02fg\x07+\x02\x02g\f\x03\x02\x02\x02h","i\x07k\x02\x02ij\x07h\x02\x02j\x0e\x03\x02\x02\x02","kl\x07?\x02\x02lm\x07?\x02\x02m\x10\x03\x02\x02","\x02no\x07d\x02\x02op\x07c\x02\x02pq\x07t\x02\x02","qr\x07t\x02\x02rs\x07k\x02\x02st\x07g\x02\x02tu\x07","t\x02\x02u\x12\x03\x02\x02\x02vw\x07Q\x02\x02wx","\x07R\x02\x02xy\x07G\x02\x02yz\x07P\x02\x02z{\x07","S\x02\x02{|\x07C\x02\x02|}\x07U\x02\x02}~\x07O\x02","\x02~\x14\x03\x02\x02\x02\x7f\x80\x07k\x02\x02","\x80\x81\x07p\x02\x02\x81\x82\x07e\x02\x02\x82","\x83\x07n\x02\x02\x83\x84\x07w\x02\x02\x84\x85","\x07f\x02\x02\x85\x86\x07g\x02\x02\x86\x16\x03","\x02\x02\x02\x87\x88\x07s\x02\x02\x88\x89\x07","t\x02\x02\x89\x8a\x07g\x02\x02\x8a\x8b\x07i\x02","\x02\x8b\x18\x03\x02\x02\x02\x8c\x8d\x07]\x02","\x02\x8d\x1a\x03\x02\x02\x02\x8e\x8f\x07_\x02","\x02\x8f\x1c\x03\x02\x02\x02\x90\x91\x07e\x02","\x02\x91\x92\x07t\x02\x02\x92\x93\x07g\x02\x02","\x93\x94\x07i\x02\x02\x94\x1e\x03\x02\x02\x02","\x95\x96\x07i\x02\x02\x96\x97\x07c\x02\x02\x97","\x98\x07v\x02\x02\x98\x99\x07g\x02\x02\x99 \x03",'\x02\x02\x02\x9a\x9b\x07}\x02\x02\x9b"\x03\x02',"\x02\x02\x9c\x9d\x07o\x02\x02\x9d\x9e\x07g\x02","\x02\x9e\x9f\x07c\x02\x02\x9f\xa0\x07u\x02\x02","\xa0\xa1\x07w\x02\x02\xa1\xa2\x07t\x02\x02\xa2","\xa3\x07g\x02\x02\xa3$\x03\x02\x02\x02\xa4\xa5","\x07/\x02\x02\xa5\xa6\x07@\x02\x02\xa6&\x03\x02","\x02\x02\xa7\xa8\x07t\x02\x02\xa8\xa9\x07g\x02","\x02\xa9\xaa\x07u\x02\x02\xaa\xab\x07g\x02\x02","\xab\xac\x07v\x02\x02\xac(\x03\x02\x02\x02\xad","\xae\x07W\x02\x02\xae*\x03\x02\x02\x02\xaf\xb0","\x07E\x02\x02\xb0\xb1\x07Z\x02\x02\xb1,\x03\x02","\x02\x02\xb2\xb3\x07.\x02\x02\xb3.\x03\x02\x02","\x02\xb4\xb5\x07`\x02\x02\xb50\x03\x02\x02\x02","\xb6\xb7\x07,\x02\x02\xb72\x03\x02\x02\x02\xb8","\xb9\x071\x02\x02\xb94\x03\x02\x02\x02\xba\xbb","\x07-\x02\x02\xbb6\x03\x02\x02\x02\xbc\xbd\x07","/\x02\x02\xbd8\x03\x02\x02\x02\xbe\xbf\x07u\x02","\x02\xbf\xc0\x07k\x02\x02\xc0\xc1\x07p\x02\x02","\xc1:\x03\x02\x02\x02\xc2\xc3\x07e\x02\x02\xc3","\xc4\x07q\x02\x02\xc4\xc5\x07u\x02\x02\xc5<\x03","\x02\x02\x02\xc6\xc7\x07v\x02\x02\xc7\xc8\x07","c\x02\x02\xc8\xc9\x07p\x02\x02\xc9>\x03\x02\x02","\x02\xca\xcb\x07g\x02\x02\xcb\xcc\x07z\x02\x02","\xcc\xcd\x07r\x02\x02\xcd@\x03\x02\x02\x02\xce","\xcf\x07n\x02\x02\xcf\xd0\x07p\x02\x02\xd0B\x03","\x02\x02\x02\xd1\xd2\x07u\x02\x02\xd2\xd3\x07","s\x02\x02\xd3\xd4\x07t\x02\x02\xd4\xd5\x07v\x02","\x02\xd5D\x03\x02\x02\x02\xd6\xd7\x07r\x02\x02","\xd7\xd8\x07k\x02\x02\xd8F\x03\x02\x02\x02\xd9","\xda\x05I%\x02\xda\xdb\x05K&\x02\xdb\xe1\x03\x02","\x02\x02\xdc\xdd\x05M'\x02\xdd\xde\x05K&\x02\xde","\xe1\x03\x02\x02\x02\xdf\xe1\x05I%\x02\xe0\xd9","\x03\x02\x02\x02\xe0\xdc\x03\x02\x02\x02\xe0\xdf","\x03\x02\x02\x02\xe1H\x03\x02\x02\x02\xe2\xe3","\x05M'\x02\xe3\xe5\x070\x02\x02\xe4\xe6\t\x02\x02","\x02\xe5\xe4\x03\x02\x02\x02\xe6\xe7\x03\x02\x02","\x02\xe7\xe5\x03\x02\x02\x02\xe7\xe8\x03\x02\x02","\x02\xe8J\x03\x02\x02\x02\xe9\xea\t\x03\x02\x02","\xea\xec\t\x04\x02\x02\xeb\xed\t\x02\x02\x02\xec","\xeb\x03\x02\x02\x02\xed\xee\x03\x02\x02\x02\xee","\xec\x03\x02\x02\x02\xee\xef\x03\x02\x02\x02\xef","L\x03\x02\x02\x02\xf0\xf2\t\x02\x02\x02\xf1\xf0","\x03\x02\x02\x02\xf2\xf3\x03\x02\x02\x02\xf3\xf1","\x03\x02\x02\x02\xf3\xf4\x03\x02\x02\x02\xf4N","\x03\x02\x02\x02\xf5\xf9\t\x05\x02\x02\xf6\xf8","\t\x06\x02\x02\xf7\xf6\x03\x02\x02\x02\xf8\xfb","\x03\x02\x02\x02\xf9\xf7\x03\x02\x02\x02\xf9\xfa","\x03\x02\x02\x02\xfaP\x03\x02\x02\x02\xfb\xf9","\x03\x02\x02\x02\xfc\xfe\t\x07\x02\x02\xfd\xfc","\x03\x02\x02\x02\xfe\xff\x03\x02\x02\x02\xff\xfd","\x03\x02\x02\x02\xff\u0100\x03\x02\x02\x02\u0100\u0101","\x03\x02\x02\x02\u0101\u0102\b)\x02\x02\u0102R\x03\x02","\x02\x02\u0103\u0105\x07$\x02\x02\u0104\u0106\t\b\x02\x02","\u0105\u0104\x03\x02\x02\x02\u0106\u0107\x03\x02\x02\x02","\u0107\u0105\x03\x02\x02\x02\u0107\u0108\x03\x02\x02\x02","\u0108\u0109\x03\x02\x02\x02\u0109\u010a\x07$\x02\x02","\u010aT\x03\x02\x02\x02\u010b\u010c\x071\x02\x02\u010c","\u010d\x07,\x02\x02\u010d\u0111\x03\x02\x02\x02\u010e","\u0110\v\x02\x02\x02\u010f\u010e\x03\x02\x02\x02\u0110","\u0113\x03\x02\x02\x02\u0111\u0112\x03\x02\x02\x02\u0111","\u010f\x03\x02\x02\x02\u0112\u0114\x03\x02\x02\x02\u0113","\u0111\x03\x02\x02\x02\u0114\u0115\x07,\x02\x02\u0115","\u0116\x071\x02\x02\u0116\u0117\x03\x02\x02\x02\u0117","\u0118\b+\x02\x02\u0118V\x03\x02\x02\x02\u0119\u011a\x07","1\x02\x02\u011a\u011b\x071\x02\x02\u011b\u011f\x03\x02","\x02\x02\u011c\u011e\n\t\x02\x02\u011d\u011c\x03\x02\x02","\x02\u011e\u0121\x03\x02\x02\x02\u011f\u011d\x03\x02\x02","\x02\u011f\u0120\x03\x02\x02\x02\u0120\u0122\x03\x02\x02","\x02\u0121\u011f\x03\x02\x02\x02\u0122\u0123\b,\x02\x02","\u0123X\x03\x02\x02\x02\f\x02\xe0\xe7\xee\xf3\xf9","\xff\u0107\u0111\u011f\x03\b\x02\x02"].join(""),atn=(new antlr4.atn.ATNDeserializer).deserialize(serializedATN),decisionsToDFA=atn.decisionToState.map(function(ds,index){return new antlr4.dfa.DFA(ds,index)});function QASMLexer(input){return antlr4.Lexer.call(this,input),this._interp=new antlr4.atn.LexerATNSimulator(this,atn,decisionsToDFA,new antlr4.PredictionContextCache),this}(QASMLexer.prototype=Object.create(antlr4.Lexer.prototype)).constructor=QASMLexer,Object.defineProperty(QASMLexer.prototype,"atn",{get:function(){return atn}}),QASMLexer.EOF=antlr4.Token.EOF,QASMLexer.T__0=1,QASMLexer.T__1=2,QASMLexer.T__2=3,QASMLexer.T__3=4,QASMLexer.T__4=5,QASMLexer.T__5=6,QASMLexer.T__6=7,QASMLexer.T__7=8,QASMLexer.T__8=9,QASMLexer.T__9=10,QASMLexer.T__10=11,QASMLexer.T__11=12,QASMLexer.T__12=13,QASMLexer.T__13=14,QASMLexer.T__14=15,QASMLexer.T__15=16,QASMLexer.T__16=17,QASMLexer.T__17=18,QASMLexer.T__18=19,QASMLexer.T__19=20,QASMLexer.T__20=21,QASMLexer.T__21=22,QASMLexer.T__22=23,QASMLexer.T__23=24,QASMLexer.T__24=25,QASMLexer.T__25=26,QASMLexer.T__26=27,QASMLexer.T__27=28,QASMLexer.T__28=29,QASMLexer.T__29=30,QASMLexer.T__30=31,QASMLexer.T__31=32,QASMLexer.T__32=33,QASMLexer.PI=34,QASMLexer.REAL=35,QASMLexer.SUBREAL=36,QASMLexer.EXPREAL=37,QASMLexer.INT=38,QASMLexer.ID=39,QASMLexer.WS=40,QASMLexer.FILENAME=41,QASMLexer.COMMENT=42,QASMLexer.LINE_COMMENT=43,QASMLexer.prototype.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],QASMLexer.prototype.modeNames=["DEFAULT_MODE"],QASMLexer.prototype.literalNames=[null,"'}'","'opaque'","';'","'('","')'","'if'","'=='","'barrier'","'OPENQASM'","'include'","'qreg'","'['","']'","'creg'","'gate'","'{'","'measure'","'->'","'reset'","'U'","'CX'","','","'^'","'*'","'/'","'+'","'-'","'sin'","'cos'","'tan'","'exp'","'ln'","'sqrt'","'pi'"],QASMLexer.prototype.symbolicNames=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"PI","REAL","SUBREAL","EXPREAL","INT","ID","WS","FILENAME","COMMENT","LINE_COMMENT"],QASMLexer.prototype.ruleNames=["T__0","T__1","T__2","T__3","T__4","T__5","T__6","T__7","T__8","T__9","T__10","T__11","T__12","T__13","T__14","T__15","T__16","T__17","T__18","T__19","T__20","T__21","T__22","T__23","T__24","T__25","T__26","T__27","T__28","T__29","T__30","T__31","T__32","PI","REAL","SUBREAL","EXPREAL","INT","ID","WS","FILENAME","COMMENT","LINE_COMMENT"],QASMLexer.prototype.grammarFileName="QASM.g4",exports.QASMLexer=QASMLexer},{"antlr4/index":47}],3:[function(require,module,exports){var antlr4=require("antlr4/index");function QASMListener(){return antlr4.tree.ParseTreeListener.call(this),this}((QASMListener.prototype=Object.create(antlr4.tree.ParseTreeListener.prototype)).constructor=QASMListener).prototype.enterMainprog=function(ctx){},QASMListener.prototype.exitMainprog=function(ctx){},QASMListener.prototype.enterStatement=function(ctx){},QASMListener.prototype.exitStatement=function(ctx){},QASMListener.prototype.enterVersion=function(ctx){},QASMListener.prototype.exitVersion=function(ctx){},QASMListener.prototype.enterInclude=function(ctx){},QASMListener.prototype.exitInclude=function(ctx){},QASMListener.prototype.enterFilename=function(ctx){},QASMListener.prototype.exitFilename=function(ctx){},QASMListener.prototype.enterDecl=function(ctx){},QASMListener.prototype.exitDecl=function(ctx){},QASMListener.prototype.enterGatedecl=function(ctx){},QASMListener.prototype.exitGatedecl=function(ctx){},QASMListener.prototype.enterGoplist=function(ctx){},QASMListener.prototype.exitGoplist=function(ctx){},QASMListener.prototype.enterQop=function(ctx){},QASMListener.prototype.exitQop=function(ctx){},QASMListener.prototype.enterUop=function(ctx){},QASMListener.prototype.exitUop=function(ctx){},QASMListener.prototype.enterAnylist=function(ctx){},QASMListener.prototype.exitAnylist=function(ctx){},QASMListener.prototype.enterIdlist=function(ctx){},QASMListener.prototype.exitIdlist=function(ctx){},QASMListener.prototype.enterMixedlist=function(ctx){},QASMListener.prototype.exitMixedlist=function(ctx){},QASMListener.prototype.enterArgument=function(ctx){},QASMListener.prototype.exitArgument=function(ctx){},QASMListener.prototype.enterExplist=function(ctx){},QASMListener.prototype.exitExplist=function(ctx){},QASMListener.prototype.enterExp=function(ctx){},QASMListener.prototype.exitExp=function(ctx){},QASMListener.prototype.enterAtom=function(ctx){},QASMListener.prototype.exitAtom=function(ctx){},QASMListener.prototype.enterUnaryop=function(ctx){},QASMListener.prototype.exitUnaryop=function(ctx){},exports.QASMListener=QASMListener},{"antlr4/index":47}],4:[function(require,module,exports){var antlr4=require("antlr4/index"),QASMListener=require("./QASMListener").QASMListener,serializedATN=["\x03\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964","\x03-\u0130\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t","\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07\t\x07\x04","\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04","\r\t\r\x04\x0e\t\x0e\x04\x0f\t\x0f\x04\x10\t\x10\x04","\x11\t\x11\x04\x12\t\x12\x04\x13\t\x13\x03\x02\x03","\x02\x07\x02)\n\x02\f\x02\x0e\x02,\v\x02\x03\x03","\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03","\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03","\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03","\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03","\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03","\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03","\x03\x03\x03\x03\x03\x03\x03\x03\x05\x03W\n\x03","\x03\x04\x03\x04\x03\x04\x03\x04\x03\x05\x03\x05","\x03\x05\x03\x05\x03\x06\x03\x06\x03\x07\x03\x07","\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07","\x03\x07\x03\x07\x03\x07\x03\x07\x05\x07o\n\x07","\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03","\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03","\b\x03\b\x03\b\x05\b\x85\n\b\x03\t\x03\t\x03\t\x03\t","\x03\t\x06\t\x8c\n\t\r\t\x0e\t\x8d\x03\n\x03\n\x03\n","\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x05","\n\x9b\n\n\x03\v\x03\v\x03\v\x03\v\x03\v","\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v","\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v","\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v","\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v","\x03\v\x05\v\xbb\n\v\x03\f\x03\f\x05\f\xbf","\n\f\x03\r\x03\r\x07\r\xc3\n\r\f\r\x0e\r\xc6\v\r\x03","\r\x03\r\x03\x0e\x03\x0e\x03\x0e\x03\x0e\x03\x0e","\x07\x0e\xcf\n\x0e\f\x0e\x0e\x0e\xd2\v\x0e\x03","\x0e\x03\x0e\x03\x0e\x03\x0e\x03\x0e\x03\x0e\x07","\x0e\xda\n\x0e\f\x0e\x0e\x0e\xdd\v\x0e\x03\x0e","\x03\x0e\x03\x0e\x03\x0e\x03\x0e\x03\x0e\x07\x0e","\xe5\n\x0e\f\x0e\x0e\x0e\xe8\v\x0e\x03\x0e\x03","\x0e\x07\x0e\xec\n\x0e\f\x0e\x0e\x0e\xef\v\x0e","\x03\x0e\x03\x0e\x03\x0e\x03\x0e\x05\x0e\xf5\n","\x0e\x03\x0f\x03\x0f\x03\x0f\x03\x0f\x03\x0f\x05","\x0f\xfc\n\x0f\x03\x10\x03\x10\x03\x10\x07\x10","\u0101\n\x10\f\x10\x0e\x10\u0104\v\x10\x03\x10\x03","\x10\x03\x11\x03\x11\x05\x11\u010a\n\x11\x03\x11","\x03\x11\x03\x11\x03\x11\x03\x11\x05\x11\u0111\n","\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03","\x11\x05\x11\u0119\n\x11\x03\x11\x05\x11\u011c\n\x11","\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11","\x03\x11\x03\x11\x03\x11\x07\x11\u0127\n\x11\f\x11","\x0e\x11\u012a\v\x11\x03\x12\x03\x12\x03\x13\x03","\x13\x03\x13\x02\x03 \x14\x02\x04\x06\b\n\f\x0e",'\x10\x12\x14\x16\x18\x1a\x1c\x1e "$\x02\x06\x03',"\x02\x1c\x1d\x03\x02\x1a\x1b\x04\x02$%()\x03\x02","\x1e#\x02\u0144\x02&\x03\x02\x02\x02\x04V\x03\x02","\x02\x02\x06X\x03\x02\x02\x02\b\\\x03\x02\x02\x02","\n`\x03\x02\x02\x02\fn\x03\x02\x02\x02\x0e\x84\x03","\x02\x02\x02\x10\x8b\x03\x02\x02\x02\x12\x9a\x03","\x02\x02\x02\x14\xba\x03\x02\x02\x02\x16\xbe\x03","\x02\x02\x02\x18\xc4\x03\x02\x02\x02\x1a\xf4\x03","\x02\x02\x02\x1c\xfb\x03\x02\x02\x02\x1e\u0102\x03",'\x02\x02\x02 \u011b\x03\x02\x02\x02"\u012b\x03\x02',"\x02\x02$\u012d\x03\x02\x02\x02&*\x05\x06\x04\x02","')\x05\x04\x03\x02('\x03\x02\x02\x02),\x03\x02","\x02\x02*(\x03\x02\x02\x02*+\x03\x02\x02\x02+\x03","\x03\x02\x02\x02,*\x03\x02\x02\x02-W\x05\f\x07\x02","./\x05\x0e\b\x02/0\x05\x10\t\x0201\x07\x03\x02\x02","1W\x03\x02\x02\x0223\x05\x0e\b\x0234\x07\x03\x02","\x024W\x03\x02\x02\x0256\x07\x04\x02\x0267\x07)","\x02\x0278\x05\x18\r\x0289\x07\x05\x02\x029W\x03","\x02\x02\x02:;\x07\x04\x02\x02;<\x07)\x02\x02<=","\x07\x06\x02\x02=>\x07\x07\x02\x02>?\x05\x18\r\x02","?@\x07\x05\x02\x02@W\x03\x02\x02\x02AB\x07\x04\x02","\x02BC\x07)\x02\x02CD\x07\x06\x02\x02DE\x05\x18","\r\x02EF\x07\x07\x02\x02FG\x05\x18\r\x02GH\x07\x05","\x02\x02HW\x03\x02\x02\x02IW\x05\x12\n\x02JK\x07","\b\x02\x02KL\x07\x06\x02\x02LM\x07)\x02\x02MN\x07","\t\x02\x02NO\x07(\x02\x02OP\x07\x07\x02\x02PW\x05","\x12\n\x02QR\x07\n\x02\x02RS\x05\x16\f\x02ST\x07\x05","\x02\x02TW\x03\x02\x02\x02UW\x05\b\x05\x02V-\x03","\x02\x02\x02V.\x03\x02\x02\x02V2\x03\x02\x02\x02","V5\x03\x02\x02\x02V:\x03\x02\x02\x02VA\x03\x02\x02","\x02VI\x03\x02\x02\x02VJ\x03\x02\x02\x02VQ\x03\x02","\x02\x02VU\x03\x02\x02\x02W\x05\x03\x02\x02\x02","XY\x07\v\x02\x02YZ\x07%\x02\x02Z[\x07\x05\x02","\x02[\x07\x03\x02\x02\x02\\]\x07\f\x02\x02]^\x05","\n\x06\x02^_\x07\x05\x02\x02_\t\x03\x02\x02\x02","`a\x07+\x02\x02a\v\x03\x02\x02\x02bc\x07\r\x02","\x02cd\x07)\x02\x02de\x07\x0e\x02\x02ef\x07(\x02","\x02fg\x07\x0f\x02\x02go\x07\x05\x02\x02hi\x07\x10","\x02\x02ij\x07)\x02\x02jk\x07\x0e\x02\x02kl\x07","(\x02\x02lm\x07\x0f\x02\x02mo\x07\x05\x02\x02nb","\x03\x02\x02\x02nh\x03\x02\x02\x02o\r\x03\x02\x02","\x02pq\x07\x11\x02\x02qr\x07)\x02\x02rs\x05\x18","\r\x02st\x07\x12\x02\x02t\x85\x03\x02\x02\x02uv","\x07\x11\x02\x02vw\x07)\x02\x02wx\x07\x06\x02\x02","xy\x07\x07\x02\x02yz\x05\x18\r\x02z{\x07\x12\x02","\x02{\x85\x03\x02\x02\x02|}\x07\x11\x02\x02}~\x07",")\x02\x02~\x7f\x07\x06\x02\x02\x7f\x80\x05\x18","\r\x02\x80\x81\x07\x07\x02\x02\x81\x82\x05\x18","\r\x02\x82\x83\x07\x12\x02\x02\x83\x85\x03\x02","\x02\x02\x84p\x03\x02\x02\x02\x84u\x03\x02\x02","\x02\x84|\x03\x02\x02\x02\x85\x0f\x03\x02\x02","\x02\x86\x8c\x05\x14\v\x02\x87\x88\x07\n\x02","\x02\x88\x89\x05\x18\r\x02\x89\x8a\x07\x05\x02","\x02\x8a\x8c\x03\x02\x02\x02\x8b\x86\x03\x02\x02","\x02\x8b\x87\x03\x02\x02\x02\x8c\x8d\x03\x02\x02","\x02\x8d\x8b\x03\x02\x02\x02\x8d\x8e\x03\x02\x02","\x02\x8e\x11\x03\x02\x02\x02\x8f\x9b\x05\x14\v","\x02\x90\x91\x07\x13\x02\x02\x91\x92\x05\x1c\x0f","\x02\x92\x93\x07\x14\x02\x02\x93\x94\x05\x1c\x0f","\x02\x94\x95\x07\x05\x02\x02\x95\x9b\x03\x02\x02","\x02\x96\x97\x07\x15\x02\x02\x97\x98\x05\x1c\x0f","\x02\x98\x99\x07\x05\x02\x02\x99\x9b\x03\x02\x02","\x02\x9a\x8f\x03\x02\x02\x02\x9a\x90\x03\x02\x02","\x02\x9a\x96\x03\x02\x02\x02\x9b\x13\x03\x02\x02","\x02\x9c\x9d\x07\x16\x02\x02\x9d\x9e\x07\x06\x02","\x02\x9e\x9f\x05\x1e\x10\x02\x9f\xa0\x07\x07\x02","\x02\xa0\xa1\x05\x1c\x0f\x02\xa1\xa2\x07\x05\x02","\x02\xa2\xbb\x03\x02\x02\x02\xa3\xa4\x07\x17\x02","\x02\xa4\xa5\x05\x1c\x0f\x02\xa5\xa6\x07\x18\x02","\x02\xa6\xa7\x05\x1c\x0f\x02\xa7\xa8\x07\x05\x02","\x02\xa8\xbb\x03\x02\x02\x02\xa9\xaa\x07)\x02","\x02\xaa\xab\x05\x16\f\x02\xab\xac\x07\x05\x02","\x02\xac\xbb\x03\x02\x02\x02\xad\xae\x07)\x02","\x02\xae\xaf\x07\x06\x02\x02\xaf\xb0\x07\x07\x02","\x02\xb0\xb1\x05\x16\f\x02\xb1\xb2\x07\x05\x02","\x02\xb2\xbb\x03\x02\x02\x02\xb3\xb4\x07)\x02","\x02\xb4\xb5\x07\x06\x02\x02\xb5\xb6\x05\x1e\x10","\x02\xb6\xb7\x07\x07\x02\x02\xb7\xb8\x05\x16\f","\x02\xb8\xb9\x07\x05\x02\x02\xb9\xbb\x03\x02\x02","\x02\xba\x9c\x03\x02\x02\x02\xba\xa3\x03\x02\x02","\x02\xba\xa9\x03\x02\x02\x02\xba\xad\x03\x02\x02","\x02\xba\xb3\x03\x02\x02\x02\xbb\x15\x03\x02\x02","\x02\xbc\xbf\x05\x18\r\x02\xbd\xbf\x05\x1a\x0e","\x02\xbe\xbc\x03\x02\x02\x02\xbe\xbd\x03\x02\x02","\x02\xbf\x17\x03\x02\x02\x02\xc0\xc1\x07)\x02","\x02\xc1\xc3\x07\x18\x02\x02\xc2\xc0\x03\x02\x02","\x02\xc3\xc6\x03\x02\x02\x02\xc4\xc2\x03\x02\x02","\x02\xc4\xc5\x03\x02\x02\x02\xc5\xc7\x03\x02\x02","\x02\xc6\xc4\x03\x02\x02\x02\xc7\xc8\x07)\x02","\x02\xc8\x19\x03\x02\x02\x02\xc9\xca\x07)\x02","\x02\xca\xcb\x07\x0e\x02\x02\xcb\xcc\x07(\x02","\x02\xcc\xcd\x07\x0f\x02\x02\xcd\xcf\x07\x18\x02","\x02\xce\xc9\x03\x02\x02\x02\xcf\xd2\x03\x02\x02","\x02\xd0\xce\x03\x02\x02\x02\xd0\xd1\x03\x02\x02","\x02\xd1\xd3\x03\x02\x02\x02\xd2\xd0\x03\x02\x02","\x02\xd3\xf5\x07)\x02\x02\xd4\xd5\x07)\x02\x02","\xd5\xd6\x07\x0e\x02\x02\xd6\xd7\x07(\x02\x02","\xd7\xd8\x07\x0f\x02\x02\xd8\xda\x07\x18\x02\x02","\xd9\xd4\x03\x02\x02\x02\xda\xdd\x03\x02\x02\x02","\xdb\xd9\x03\x02\x02\x02\xdb\xdc\x03\x02\x02\x02","\xdc\xde\x03\x02\x02\x02\xdd\xdb\x03\x02\x02\x02","\xde\xdf\x07)\x02\x02\xdf\xe0\x07\x0e\x02\x02","\xe0\xe1\x07(\x02\x02\xe1\xf5\x07\x0f\x02\x02","\xe2\xe3\x07)\x02\x02\xe3\xe5\x07\x18\x02\x02","\xe4\xe2\x03\x02\x02\x02\xe5\xe8\x03\x02\x02\x02","\xe6\xe4\x03\x02\x02\x02\xe6\xe7\x03\x02\x02\x02","\xe7\xe9\x03\x02\x02\x02\xe8\xe6\x03\x02\x02\x02","\xe9\xea\x07)\x02\x02\xea\xec\x07\x18\x02\x02","\xeb\xe6\x03\x02\x02\x02\xec\xef\x03\x02\x02\x02","\xed\xeb\x03\x02\x02\x02\xed\xee\x03\x02\x02\x02","\xee\xf0\x03\x02\x02\x02\xef\xed\x03\x02\x02\x02","\xf0\xf1\x07)\x02\x02\xf1\xf2\x07\x0e\x02\x02","\xf2\xf3\x07(\x02\x02\xf3\xf5\x07\x0f\x02\x02","\xf4\xd0\x03\x02\x02\x02\xf4\xdb\x03\x02\x02\x02","\xf4\xed\x03\x02\x02\x02\xf5\x1b\x03\x02\x02\x02","\xf6\xfc\x07)\x02\x02\xf7\xf8\x07)\x02\x02\xf8","\xf9\x07\x0e\x02\x02\xf9\xfa\x07(\x02\x02\xfa","\xfc\x07\x0f\x02\x02\xfb\xf6\x03\x02\x02\x02\xfb","\xf7\x03\x02\x02\x02\xfc\x1d\x03\x02\x02\x02\xfd","\xfe\x05 \x11\x02\xfe\xff\x07\x18\x02\x02\xff","\u0101\x03\x02\x02\x02\u0100\xfd\x03\x02\x02\x02\u0101","\u0104\x03\x02\x02\x02\u0102\u0100\x03\x02\x02\x02\u0102","\u0103\x03\x02\x02\x02\u0103\u0105\x03\x02\x02\x02\u0104","\u0102\x03\x02\x02\x02\u0105\u0106\x05 \x11\x02\u0106","\x1f\x03\x02\x02\x02\u0107\u0109\b\x11\x01\x02\u0108","\u010a\t\x02\x02\x02\u0109\u0108\x03\x02\x02\x02\u0109","\u010a\x03\x02\x02\x02\u010a\u010b\x03\x02\x02\x02\u010b","\u010c\x07\x06\x02\x02\u010c\u010d\x05 \x11\x02\u010d","\u010e\x07\x07\x02\x02\u010e\u011c\x03\x02\x02\x02\u010f","\u0111\t\x02\x02\x02\u0110\u010f\x03\x02\x02\x02\u0110","\u0111\x03\x02\x02\x02\u0111\u0112\x03\x02\x02\x02\u0112","\u0113\x05$\x13\x02\u0113\u0114\x07\x06\x02\x02\u0114","\u0115\x05 \x11\x02\u0115\u0116\x07\x07\x02\x02\u0116","\u011c\x03\x02\x02\x02\u0117\u0119\t\x02\x02\x02\u0118","\u0117\x03\x02\x02\x02\u0118\u0119\x03\x02\x02\x02\u0119",'\u011a\x03\x02\x02\x02\u011a\u011c\x05"\x12\x02\u011b',"\u0107\x03\x02\x02\x02\u011b\u0110\x03\x02\x02\x02\u011b","\u0118\x03\x02\x02\x02\u011c\u0128\x03\x02\x02\x02\u011d","\u011e\f\b\x02\x02\u011e\u011f\x07\x19\x02\x02\u011f\u0127","\x05 \x11\t\u0120\u0121\f\x07\x02\x02\u0121\u0122\t\x03","\x02\x02\u0122\u0127\x05 \x11\b\u0123\u0124\f\x06\x02\x02","\u0124\u0125\t\x02\x02\x02\u0125\u0127\x05 \x11\x07\u0126","\u011d\x03\x02\x02\x02\u0126\u0120\x03\x02\x02\x02\u0126","\u0123\x03\x02\x02\x02\u0127\u012a\x03\x02\x02\x02\u0128","\u0126\x03\x02\x02\x02\u0128\u0129\x03\x02\x02\x02\u0129","!\x03\x02\x02\x02\u012a\u0128\x03\x02\x02\x02\u012b","\u012c\t\x04\x02\x02\u012c#\x03\x02\x02\x02\u012d\u012e","\t\x05\x02\x02\u012e%\x03\x02\x02\x02\x19*Vn\x84\x8b","\x8d\x9a\xba\xbe\xc4\xd0\xdb\xe6\xed\xf4\xfb\u0102","\u0109\u0110\u0118\u011b\u0126\u0128"].join(""),atn=(new antlr4.atn.ATNDeserializer).deserialize(serializedATN),decisionsToDFA=atn.decisionToState.map(function(ds,index){return new antlr4.dfa.DFA(ds,index)}),sharedContextCache=new antlr4.PredictionContextCache,literalNames=[null,"'}'","'opaque'","';'","'('","')'","'if'","'=='","'barrier'","'OPENQASM'","'include'","'qreg'","'['","']'","'creg'","'gate'","'{'","'measure'","'->'","'reset'","'U'","'CX'","','","'^'","'*'","'/'","'+'","'-'","'sin'","'cos'","'tan'","'exp'","'ln'","'sqrt'","'pi'"],symbolicNames=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"PI","REAL","SUBREAL","EXPREAL","INT","ID","WS","FILENAME","COMMENT","LINE_COMMENT"],ruleNames=["mainprog","statement","version","include","filename","decl","gatedecl","goplist","qop","uop","anylist","idlist","mixedlist","argument","explist","exp","atom","unaryop"];function QASMParser(input){return antlr4.Parser.call(this,input),this._interp=new antlr4.atn.ParserATNSimulator(this,atn,decisionsToDFA,sharedContextCache),this.ruleNames=ruleNames,this.literalNames=literalNames,this.symbolicNames=symbolicNames,this}function MainprogContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_mainprog,this}function StatementContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_statement,this}function VersionContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_version,this}function IncludeContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_include,this}function FilenameContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_filename,this}function DeclContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_decl,this}function GatedeclContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_gatedecl,this}function GoplistContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_goplist,this}function QopContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_qop,this}function UopContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_uop,this}function AnylistContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_anylist,this}function IdlistContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_idlist,this}function MixedlistContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_mixedlist,this}function ArgumentContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_argument,this}function ExplistContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_explist,this}function ExpContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_exp,this}function AtomContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_atom,this}function UnaryopContext(parser,parent,invokingState){return void 0===parent&&(parent=null),null==invokingState&&(invokingState=-1),antlr4.ParserRuleContext.call(this,parent,invokingState),this.parser=parser,this.ruleIndex=QASMParser.RULE_unaryop,this}(QASMParser.prototype=Object.create(antlr4.Parser.prototype)).constructor=QASMParser,Object.defineProperty(QASMParser.prototype,"atn",{get:function(){return atn}}),QASMParser.EOF=antlr4.Token.EOF,QASMParser.T__0=1,QASMParser.T__1=2,QASMParser.T__2=3,QASMParser.T__3=4,QASMParser.T__4=5,QASMParser.T__5=6,QASMParser.T__6=7,QASMParser.T__7=8,QASMParser.T__8=9,QASMParser.T__9=10,QASMParser.T__10=11,QASMParser.T__11=12,QASMParser.T__12=13,QASMParser.T__13=14,QASMParser.T__14=15,QASMParser.T__15=16,QASMParser.T__16=17,QASMParser.T__17=18,QASMParser.T__18=19,QASMParser.T__19=20,QASMParser.T__20=21,QASMParser.T__21=22,QASMParser.T__22=23,QASMParser.T__23=24,QASMParser.T__24=25,QASMParser.T__25=26,QASMParser.T__26=27,QASMParser.T__27=28,QASMParser.T__28=29,QASMParser.T__29=30,QASMParser.T__30=31,QASMParser.T__31=32,QASMParser.T__32=33,QASMParser.PI=34,QASMParser.REAL=35,QASMParser.SUBREAL=36,QASMParser.EXPREAL=37,QASMParser.INT=38,QASMParser.ID=39,QASMParser.WS=40,QASMParser.FILENAME=41,QASMParser.COMMENT=42,QASMParser.LINE_COMMENT=43,QASMParser.RULE_mainprog=0,QASMParser.RULE_statement=1,QASMParser.RULE_version=2,QASMParser.RULE_include=3,QASMParser.RULE_filename=4,QASMParser.RULE_decl=5,QASMParser.RULE_gatedecl=6,QASMParser.RULE_goplist=7,QASMParser.RULE_qop=8,QASMParser.RULE_uop=9,QASMParser.RULE_anylist=10,QASMParser.RULE_idlist=11,QASMParser.RULE_mixedlist=12,QASMParser.RULE_argument=13,QASMParser.RULE_explist=14,QASMParser.RULE_exp=15,QASMParser.RULE_atom=16,QASMParser.RULE_unaryop=17,((MainprogContext.prototype=Object.create(antlr4.ParserRuleContext.prototype)).constructor=MainprogContext).prototype.version=function(){return this.getTypedRuleContext(VersionContext,0)},MainprogContext.prototype.statement=function(i){return void 0===i&&(i=null),null===i?this.getTypedRuleContexts(StatementContext):this.getTypedRuleContext(StatementContext,i)},MainprogContext.prototype.enterRule=function(listener){listener instanceof QASMListener&&listener.enterMainprog(this)},MainprogContext.prototype.exitRule=function(listener){listener instanceof QASMListener&&listener.exitMainprog(this)},QASMParser.MainprogContext=MainprogContext,QASMParser.prototype.mainprog=function(){var localctx=new MainprogContext(this,this._ctx,this.state);this.enterRule(localctx,0,QASMParser.RULE_mainprog);var _la=0;try{for(this.enterOuterAlt(localctx,1),this.state=36,this.version(),this.state=40,this._errHandler.sync(this),_la=this._input.LA(1);0==(-32&_la)&&0!=(1<<_la&(1<<QASMParser.T__1|1<<QASMParser.T__5|1<<QASMParser.T__7|1<<QASMParser.T__9|1<<QASMParser.T__10|1<<QASMParser.T__13|1<<QASMParser.T__14|1<<QASMParser.T__16|1<<QASMParser.T__18|1<<QASMParser.T__19|1<<QASMParser.T__20))||_la===QASMParser.ID;)this.state=37,this.statement(),this.state=42,this._errHandler.sync(this),_la=this._input.LA(1)}catch(re){if(!(re instanceof antlr4.error.RecognitionException))throw re;localctx.exception=re,this._errHandler.reportError(this,re),this._errHandler.recover(this,re)}finally{this.exitRule()}return localctx},((StatementContext.prototype=Object.create(antlr4.ParserRuleContext.prototype)).constructor=StatementContext).prototype.decl=function(){return this.getTypedRuleContext(DeclContext,0)},StatementContext.prototype.gatedecl=function(){return this.getTypedRuleContext(GatedeclContext,0)},StatementContext.prototype.goplist=function(){return this.getTypedRuleContext(GoplistContext,0)},StatementContext.prototype.ID=function(){return this.getToken(QASMParser.ID,0)},StatementContext.prototype.idlist=function(i){return void 0===i&&(i=null),null===i?this.getTypedRuleContexts(IdlistContext):this.getTypedRuleContext(IdlistContext,i)},StatementContext.prototype.qop=function(){return this.getTypedRuleContext(QopContext,0)},StatementContext.prototype.INT=function(){return this.getToken(QASMParser.INT,0)},StatementContext.prototype.anylist=function(){return this.getTypedRuleContext(AnylistContext,0)},StatementContext.prototype.include=function(){return this.getTypedRuleContext(IncludeContext,0)},StatementContext.prototype.enterRule=function(listener){listener instanceof QASMListener&&listener.enterStatement(this)},StatementContext.prototype.exitRule=function(listener){listener instanceof QASMListener&&listener.exitStatement(this)},QASMParser.StatementContext=StatementContext,QASMParser.prototype.statement=function(){var localctx=new StatementContext(this,this._ctx,this.state);this.enterRule(localctx,2,QASMParser.RULE_statement);try{switch(this.state=84,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,1,this._ctx)){case 1:this.enterOuterAlt(localctx,1),this.state=43,this.decl();break;case 2:this.enterOuterAlt(localctx,2),this.state=44,this.gatedecl(),this.state=45,this.goplist(),this.state=46,this.match(QASMParser.T__0);break;case 3:this.enterOuterAlt(localctx,3),this.state=48,this.gatedecl(),this.state=49,this.match(QASMParser.T__0);break;case 4:this.enterOuterAlt(localctx,4),this.state=51,this.match(QASMParser.T__1),this.state=52,this.match(QASMParser.ID),this.state=53,this.idlist(),this.state=54,this.match(QASMParser.T__2);break;case 5:this.enterOuterAlt(localctx,5),this.state=56,this.match(QASMParser.T__1),this.state=57,this.match(QASMParser.ID),this.state=58,this.match(QASMParser.T__3),this.state=59,this.match(QASMParser.T__4),this.state=60,this.idlist(),this.state=61,this.match(QASMParser.T__2);break;case 6:this.enterOuterAlt(localctx,6),this.state=63,this.match(QASMParser.T__1),this.state=64,this.match(QASMParser.ID),this.state=65,this.match(QASMParser.T__3),this.state=66,this.idlist(),this.state=67,this.match(QASMParser.T__4),this.state=68,this.idlist(),this.state=69,this.match(QASMParser.T__2);break;case 7:this.enterOuterAlt(localctx,7),this.state=71,this.qop();break;case 8:this.enterOuterAlt(localctx,8),this.state=72,this.match(QASMParser.T__5),this.state=73,this.match(QASMParser.T__3),this.state=74,this.match(QASMParser.ID),this.state=75,this.match(QASMParser.T__6),this.state=76,this.match(QASMParser.INT),this.state=77,this.match(QASMParser.T__4),this.state=78,this.qop();break;case 9:this.enterOuterAlt(localctx,9),this.state=79,this.match(QASMParser.T__7),this.state=80,this.anylist(),this.state=81,this.match(QASMParser.T__2);break;case 10:this.enterOuterAlt(localctx,10),this.state=83,this.include()}}catch(re){if(!(re instanceof antlr4.error.RecognitionException))throw re;localctx.exception=re,this._errHandler.reportError(this,re),this._errHandler.recover(this,re)}finally{this.exitRule()}return localctx},((VersionContext.prototype=Object.create(antlr4.ParserRuleContext.prototype)).constructor=VersionContext).prototype.REAL=function(){return this.getToken(QASMParser.REAL,0)},VersionContext.prototype.enterRule=function(listener){listener instanceof QASMListener&&listener.enterVersion(this)},VersionContext.prototype.exitRule=function(listener){listener instanceof QASMListener&&listener.exitVersion(this)},QASMParser.VersionContext=VersionContext,QASMParser.prototype.version=function(){var localctx=new VersionContext(this,this._ctx,this.state);this.enterRule(localctx,4,QASMParser.RULE_version);try{this.enterOuterAlt(localctx,1),this.state=86,this.match(QASMParser.T__8),this.state=87,this.match(QASMParser.REAL),this.state=88,this.match(QASMParser.T__2)}catch(re){if(!(re instanceof antlr4.error.RecognitionException))throw re;localctx.exception=re,this._errHandler.reportError(this,re),this._errHandler.recover(this,re)}finally{this.exitRule()}return localctx},((IncludeContext.prototype=Object.create(antlr4.ParserRuleContext.prototype)).constructor=IncludeContext).prototype.filename=function(){return this.getTypedRuleContext(FilenameContext,0)},IncludeContext.prototype.enterRule=function(listener){listener instanceof QASMListener&&listener.enterInclude(this)},IncludeContext.prototype.exitRule=function(listener){listener instanceof QASMListener&&listener.exitInclude(this)},QASMParser.IncludeContext=IncludeContext,QASMParser.prototype.include=function(){var localctx=new IncludeContext(this,this._ctx,this.state);this.enterRule(localctx,6,QASMParser.RULE_include);try{this.enterOuterAlt(localctx,1),this.state=90,this.match(QASMParser.T__9),this.state=91,this.filename(),this.state=92,this.match(QASMParser.T__2)}catch(re){if(!(re instanceof antlr4.error.RecognitionException))throw re;localctx.exception=re,this._errHandler.reportError(this,re),this._errHandler.recover(this,re)}finally{this.exitRule()}return localctx},((FilenameContext.prototype=Object.create(antlr4.ParserRuleContext.prototype)).constructor=FilenameContext).prototype.FILENAME=function(){return this.getToken(QASMParser.FILENAME,0)},FilenameContext.prototype.enterRule=function(listener){listener instanceof QASMListener&&listener.enterFilename(this)},Filename