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

Method getConstantComplex

python/cudaq/kernel/ast_bridge.py:560–569  ·  view source on GitHub ↗

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

(self, value, width=64)

Source from the content-addressed store, hash-verified

558 return ComplexType.get(eTy)
559
560 def getConstantComplex(self, value, width=64):
561 """Create a constant complex operation and return its MLIR result Value.
562
563 Takes as input the concrete complex value.
564 """
565 ty = self.getComplexType(width=width)
566 return complex.CreateOp(ty,
567 self.getConstantFloat(value.real, width=width),
568 self.getConstantFloat(value.imag,
569 width=width)).result
570
571 def getConstantComplexWithElementType(self, value, eTy):
572 """Create a constant complex operation and return its MLIR result Value.

Callers

nothing calls this directly

Calls 2

getComplexTypeMethod · 0.95
getConstantFloatMethod · 0.95

Tested by

no test coverage detected