iqm.cpc.compiler.compiler.compiler_pass#
- iqm.cpc.compiler.compiler.compiler_pass(function)#
Convenience wrapper to create a valid compiler pass.
When the wrapped function is called, the compilation data (e.g. circuits) is passed as the first argument. If
functionhas any other arguments, the wrapper takes their values from thecontextdict. If no matching key is found for a required argument, an error is raised.function` must return either a tuple of ``(data, ctx)wheredatais the compilation result andctxis a dict with any new context data, or onlydata. The contents ofctxwill be merged to the input context. Note the difference to a plain, unwrapped CompilationPass: not returningctxis valid.