// A subroutine that writes its `readonly` array argument: the argument is a // reference to the caller's array, which a `readonly` one may not change. OPENQASM 3.1; include "stdgates.inc"; def scale(readonly array[int[8], #dim = 1] a) { a[0] = 2 * a[0]; } array[int[8], 2] weights = {1, 2}; qubit[1] q; scale(weights);