MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / createInvariantForLoop

Method createInvariantForLoop

python/cudaq/kernel/ast_bridge.py:1421–1431  ·  view source on GitHub ↗

Create an invariant loop using the CC dialect.

(self, bodyBuilder, endVal)

Source from the content-addressed store, hash-verified

1419 (lambda args: orElseBuilder(args[0])))
1420
1421 def createInvariantForLoop(self, bodyBuilder, endVal):
1422 """Create an invariant loop using the CC dialect."""
1423
1424 startVal = self.getConstantInt(0)
1425 stepVal = self.getConstantInt(1)
1426
1427 loop = self.createMonotonicForLoop(bodyBuilder,
1428 startVal=startVal,
1429 stepVal=stepVal,
1430 endVal=endVal)
1431 loop.attributes.__setitem__('invariant', UnitAttr.get())
1432
1433 def __deconstructAssignment(self, target, value, process=None):
1434 if process is not None:

Callers 5

__migrateListsMethod · 0.95
visit_CallMethod · 0.95
visit_ListCompMethod · 0.95

Calls 4

getConstantIntMethod · 0.95
__setitem__Method · 0.80
getMethod · 0.45

Tested by

no test coverage detected