Q matrices for various formulations