Skip to content

Commit

Permalink
feat: Add gate modifiers and additional supported gates to AutoQASM (#…
Browse files Browse the repository at this point in the history
…958)

* Implement control, control_state, power gate modifiers

* Enable gate modifiers on custom gates

* Add prx gate

* Add physical qubit test case

* Update type checks

* Use BasisStateInput for control_state

* Simplify control_state logic

* Add docstrings and improve test parameterizations
  • Loading branch information
rmshaffer authored May 6, 2024
1 parent 72af596 commit d62e288
Show file tree
Hide file tree
Showing 6 changed files with 310 additions and 41 deletions.
5 changes: 4 additions & 1 deletion src/braket/experimental/autoqasm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def _convert_gate(
)
qubit_args = [args[i] for i in gate_args.qubit_indices]
angle_args = [args[i] for i in gate_args.angle_indices]
aq_instructions.instructions._qubit_instruction(gate_name, qubit_args, *angle_args)
aq_instructions.instructions._qubit_instruction(gate_name, qubit_args, *angle_args, **kwargs)


def _wrap_for_oqpy_gate(
Expand Down Expand Up @@ -574,6 +574,9 @@ def _get_gate_args(f: Callable) -> aq_program.GateArgs:
gate_args = aq_program.GateArgs()
sig = inspect.signature(f)
for param in sig.parameters.values():
if param.kind == param.VAR_KEYWORD:
continue

if param.annotation is param.empty:
raise errors.MissingParameterTypeError(
f'Parameter "{param.name}" for gate "{f.__name__}" '
Expand Down
Loading

0 comments on commit d62e288

Please sign in to comment.