You have to implement a random_element method by yourself, since sage will not discover which measure has to be sampled.
You have to implement a random_element method by yourself, since sage will not discover which measure has to be sampled.sampled. If the property happens frequently among all matrices, you can use rejection the method: pick a random matrix (in the larger space) until you find one with the property and return that matrix.