In another interview, a chemical engineer working for a multinational oil company describes the atmosphere as “almost militaristic in terms of how they manage people” and said that they don’t even think diversity is an issue. To cope, many gays and lesbians must learn to suppress crucial aspects of their personalities and compartmentalize their lives.

The federal survey analyzed by Professor Cech shows the effects of such environmental inhospitality. L.G.B.T. workers in STEM-related fields report significantly lower job satisfaction, both when compared to other STEM workers and to L.G.B.T. workers in other fields.

Such discontent — and invisibility — can contribute to a field’s reputation for being unwelcoming. As a result, young lesbians and gays might sell themselves short, aiming for occupations with little use for their talents, but in which they see more people like themselves.

In addition to facilitating greater intellectual fulfillment, diversity in the work force also helps the field. For instance, work by Andras Tilcsik at the Rotman School of Management at the University of Toronto and his collaborators shows that gays and lesbians develop enhanced skills in social perceptiveness — a trait not traditionally sought in engineering settings, but one that could help make them more responsive to human needs.

Although there has been a concerted effort to make STEM fields more diverse in terms of gender and race, L.G.B.T. participation has received comparatively scant attention or resources. An exception is a recent grant by the National Science Foundation to address prejudice against sexual minorities in academic engineering departments. Grass-roots organizations like Out in STEM and the National Organization for Gay and Lesbian Scientists and Technical Professionals are taking the lead to provide mentoring and networking — activities that have proved indispensable in the retention of women and minorities.

An essential step is to break self-perpetuating patterns of concealment. Teachers must come out not just to colleagues, but to students — some of whom will need role models, and all of whom must get used to visible L.G.B.T. professionals to prepare for future workplace settings.

More critically, STEM culture must rein in the pressure to separate professional and personal identities. It should view its workers more holistically, welcoming their interests and differences as sources of enhanced resourcefulness.