Partitioning qubits in hypergraph product codes to implement logical gates