Direct product of two gates. Qubit count is the sum of each gate's
    bit count.

def join_gates(*gates: Gate) -> Gate:
    """Direct product of two gates. Qubit count is the sum of each gate's
    bit count."""
    vectors = [gate.vec for gate in gates]
    vec = reduce(outer_product, vectors)
    return Gate(vec.tensor, vec.qubits)