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

Method containsList

python/cudaq/kernel/ast_bridge.py:493–502  ·  view source on GitHub ↗

Returns true if the give type is a vector or contains items that are vectors.

(self, ty, innerListsOnly=False)

Source from the content-addressed store, hash-verified

491 isinstance(value.owner.owner, func.FuncOp))
492
493 def containsList(self, ty, innerListsOnly=False):
494 """Returns true if the give type is a vector or contains items that are
495 vectors."""
496 if cc.StdvecType.isinstance(ty):
497 return (not innerListsOnly or
498 self.containsList(cc.StdvecType.getElementType(ty)))
499 if not cc.StructType.isinstance(ty):
500 return False
501 eleTys = cc.StructType.getTypes(ty)
502 return any((self.containsList(t) for t in eleTys))
503
504 def getIntegerType(self, width=64):
505 """Return an MLIR `IntegerType` of the given bit width (defaults to 64

Callers 5

conversionMethod · 0.95
__migrateListsMethod · 0.95
process_assignmentMethod · 0.95
visit_ReturnMethod · 0.95

Calls 1

getElementTypeMethod · 0.80

Tested by

no test coverage detected