Dilithium crystals generally do not appear in the main branch of the dungeon until you have reached at least dungeon level 27, though they can be found with many other gems in the mines.
In variants that include gem alchemy (SLASH'EM and dNetHack), the dilithium crystal is the only valuable gems that does not turn a potion of acid into another potion when dipped into it. Instead, it explodes.
This could be used to identify dilithium crystals, though it would be an impractical method, given that the crystal is destroyed in the process. It could also be used to identify potions of acid, though by the time you start seeing dilithium crystals, you will probably have encountered potions of acid and recognized them (for example, by having seen them thrown by a monster).
Dilithium is an important fictional mineral from Star Trek.
The most famous and the first to be named of the imaginary
"minerals" of Star Trek is dilithium. ... Because of this
mineral's central role in the storyline, a whole mythology
surrounds it. It is, however, a naturally occurring substance
within the mythology, as there are various episodes that
make reference to the mining of dilithium deposits. ...
This name itself is imaginary and gives no real information on
the structure or make-up of this substance other than that this
version of the name implies a lithium and iron-bearing
aluminosilicate of some sort. That said, the real mineral that
most closely matches the descriptive elements of this name is
ferroholmquistite which is a dilithium triferrodiallosilicate.
If one goes on the premise that nature follows certain general
norms, then one could extrapolate that dilithium might have a
similar number of silicon atoms in its structure.
Keeping seven (i.e. hepto) ferrous irons and balancing the
oxygens would give a theoretical formula of Li2Fe7Al2Si8O27.
A mineral with this composition could theoretically exist,
although it is doubtful that it would possess the more fantastic
properties ascribed to dilithium.
[ The Mineralogy of Star Trek, by Jeffrey de Fourestier ]