How to use the pyqpanda.pyQPanda.CreateIfProg function in pyqpanda

To help you get started, we’ve selected a few pyqpanda examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OriginQ / QPanda-2 / pyQPanda / pyqpanda / pywrapper.py View on Github external
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)
github OriginQ / QPanda-2 / pyQPanda / pyqpanda / pywrapper.py View on Github external
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)