In initial data preparation, your code has
Dgate(disps_alpha) | q
Dgate(disps_beta) | q
where disps_alpha and disps_beta are lists of length 7.
disps_alpha = tf.constant(
[alpha, -alpha, alpha, -alpha, 1.0j * alpha, -1.0j * alpha, 1.0j * alpha]
My understanding is that Dgate takes at most 2 parameters. What am I missing?