Build it from daily returns over a sensible window - 60 to 120 trading days is typical - and read the off-diagonal entries. Anything above 0.7 is effectively the same position; 0.3 to 0.7 is partial overlap; below 0.3 is genuine diversification.
Two practical habits. First, compute it including cash and any hedges, so the offsetting effects show up. Second, compute it twice: once over the full window and once over the worst 10% of market days. The second matrix is the one that applies when you need it, and its numbers are always higher - see correlation-breakdown.
Treat it as a screening tool rather than a precise instrument. Correlations are noisy, unstable, and estimated from a short sample, so the useful signal is the grouping structure - which names move together - not the third decimal place.
Related: correlation, correlation-breakdown, portfolio-volatility, sector-exposure