Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def CreateIfProg(classical_condition,
true_branch,
false_branch=None):
"""
`QPanda Basic API` \n
Create a q-if subprogram \n
(ClassicalCondition,QNode,QNode) -> QProg
QNode = QProg | QCircuit | QGate
"""
if false_branch is None:
return pyQPanda.CreateIfProg(classical_condition,
true_branch)
else:
return pyQPanda.CreateIfProg(classical_condition,
true_branch, false_branch)
def CreateIfProg(classical_condition,
true_branch,
false_branch=None):
"""
`QPanda Basic API` \n
Create a q-if subprogram \n
(ClassicalCondition,QNode,QNode) -> QProg
QNode = QProg | QCircuit | QGate
"""
if false_branch is None:
return pyQPanda.CreateIfProg(classical_condition,
true_branch)
else:
return pyQPanda.CreateIfProg(classical_condition,
true_branch, false_branch)