Handler for wasm files in pytket

class pytket.wasm.WasmFileHandler(filepath: str, check_file: bool = True)#

Add a wasm file to your workflow, stores a copy of the file and checks the function signatures of the file. Offers function to add a wasm op to a circuit

__init__(filepath: str, check_file: bool = True)#

construct a wasm file handler :param filepath: path to the wasm file :type filepath: str

__repr__() str#

str representation of the containment of the wasm file

__str__() str#

str representation of the wasm file

check_function(function_name: str, number_of_parameters: int, number_of_returns: int) bool#

checks a given function name and signature if it is included :param function_name: name of the function that is checked :type function_name: str :param number_of_parameters: number of i32 parameters of the function :type number_of_parameters: int :param number_of_returns: number of i32 return values of the function :type number_of_returns: int :return: true if the signature and the name of the function is correct