<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/quantum/blob/v0.7.6/tensorflow_quantum/core/ops/tfq_utility_ops.py#L22-L65) |

Merge programs in the input tensors.

    tfq.append_circuit(
        programs, programs_to_append
    )

Given two tensors of programs, this function merges the programs pairwise
and returns a single tensor containing the merged programs. Note that this
function is not differentiable because the output has type string.

    q = cirq.GridQubit(0, 0)
    p0 = [cirq.Circuit(cirq.H(q)), cirq.Circuit(cirq.S(q))]
    p1 = [cirq.Circuit(cirq.Z(q)), cirq.Circuit(cirq.X(q))]
    p0_t = tfq.convert_to_tensor(p0)
    p1_t = tfq.convert_to_tensor(p1)
    tfq.from_tensor(append_circuit(p0_t, p1_t))
    array([cirq.Circuit([
        cirq.Moment(
            cirq.H(cirq.GridQubit(0, 0)),
        ),
        cirq.Moment(
            cirq.Z(cirq.GridQubit(0, 0)),
        ),
    ]),
           cirq.Circuit([
        cirq.Moment(
            cirq.S(cirq.GridQubit(0, 0)),
        ),
        cirq.Moment(
            cirq.X(cirq.GridQubit(0, 0)),
        ),
    ])], dtype=object)

<br />

<br />

<br />

| ## Args ||
|---|---|
| `programs` | [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) of strings with shape \[batch_size\] containing the string representations of circuits. |
| `programs_to_append` | [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) of strings with shape \[batch_size\] containing the string representations of circuits to append. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) with shape \[batch_size\]. Entry `i` is the string representing the circuit which is `programs_to_append[i]` appended to `programs[i]`. ||

<br />