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

Method getConstantFloat

python/cudaq/kernel/ast_bridge.py:531–537  ·  view source on GitHub ↗

Create a constant float operation and return its MLIR result Value. Takes as input the concrete float value.

(self, value, width=64)

Source from the content-addressed store, hash-verified

529 return FloatAttr.get(type, value)
530
531 def getConstantFloat(self, value, width=64):
532 """Create a constant float operation and return its MLIR result Value.
533
534 Takes as input the concrete float value.
535 """
536 ty = self.getFloatType(width=width)
537 return self.getConstantFloatWithType(value, ty)
538
539 def getConstantFloatWithType(self, value, ty):
540 """Create a constant float operation and return its MLIR result Value.

Callers 5

getConstantComplexMethod · 0.95
__arithmetic_to_boolMethod · 0.95
visit_AttributeMethod · 0.95
visit_ConstantMethod · 0.95
visit_UnaryOpMethod · 0.95

Calls 2

getFloatTypeMethod · 0.95

Tested by

no test coverage detected