def METHOD_NAME(num_ancilla: int):
    q = cirq.LineQubit(0)
    anc = cirq.NamedQubit.range(num_ancilla, prefix='anc')
    u = cirq.MatrixGate(cirq.testing.random_unitary(2 ** (num_ancilla + 1)))
    test_circuit = cirq.Circuit(
        u.on(q, *anc), PhaseUsingDirtyAncilla(ancilla_bitsize=num_ancilla).on(q)
    )
    control_circuit = cirq.Circuit(u.on(q, *anc), cirq.Z(q))
    assert_test_circuit_for_dm_simulator(test_circuit, control_circuit)
    assert_test_circuit_for_sv_simulator(test_circuit, control_circuit)