<div id="comment:0"></div> Bug: ``` sage: V = ZZ^3 sage: U = V.submodule([[1, 2, 3], [1, 1, 1]]) sage: U sage: u = U([2, 3, 4]) sage: u.monomial_coefficients() {0: 2, 1: 3, 2: 4} ``` This is incorrect - by definition of `monomial_coefficients`, basis indices are mapped to coefficients; but ``` sage: u.parent().basis() [ (1, 0, -1), (0, 1, 2) ] ``` We also add a method `_test_monomial_coefficients` to run some tests on this and related methods of `ModulesWithBasis`. Part of #30309 CC: @tscrim @mmasdeu Component: **linear algebra** Author: **Matthias Koeppe, ...** _Issue created by migration from https://trac.sagemath.org/ticket/34455_