# Creating controlled R1 gates in Q#?

I know how to create controlled versions of gates like X, Y, Z. For example, a controlled X gate would be implemented by writing

(Controlled X)([control],target);

However, I've tried numerous times to create a controlled R1 gate with no success, and there are no examples available on the Q# documentation or elsewhere on the web from what I've seen. As an example of what I've attempted, I've tried

(Controlled R1)([control],theta,target);

and get the following error:

The shape of the given tuple does not match the argument type.

From what I gather the issue is that an X gate does not require any additional parameters, whereas an angle needs to be specified for the R1 gate to be well defined.

To see the relevant documentation, please visit R1 Operation, Q# Docs, and Operations and Functions, Q# Docs.

If the base operation takes several arguments, you need to enclose the corresponding arguments of the controlled version of the operation in parentheses to convert them into a single tuple. In your case, you need to call it as (Controlled R1)([control], (theta, target));.