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

Method getConstantInt

python/cudaq/kernel/kernel_builder.py:340–347  ·  view source on GitHub ↗

Create a constant integer operation and return its MLIR result Value. Takes as input the concrete integer value. Can specify the integer bit width.

(self, value, width=64)

Source from the content-addressed store, hash-verified

338 return IntegerType.get_signless(width)
339
340 def getConstantInt(self, value, width=64):
341 """
342 Create a constant integer operation and return its MLIR result Value.
343 Takes as input the concrete integer value. Can specify the integer bit
344 width.
345 """
346 ty = self.getIntegerType(width)
347 return arith.ConstantOp(ty, self.getIntegerAttr(ty, value)).result
348
349 def getFloatType(self, width=64):
350 """

Callers 5

bodyMethod · 0.95
apply_noiseMethod · 0.95

Calls 2

getIntegerTypeMethod · 0.95
getIntegerAttrMethod · 0.95

Tested by

no test coverage detected