I was surprised to see Graph objects are atomic. Is there a way (through documentation or programmatically) to find all atomic heads?
The ones I know of are:
Integer
Rational
Real
Complex
Symbol
String
SparseArray
StructuredArray
Image (* since v9 *)
Image3D
Graph
ColorProfileData
Association
MeshRegion
BoundaryMeshRegion
Language`ArrayObject
ByteArray
QuantityArray
RawArray
RawData
Audio
Are there any others?
Others mentioned in the comments
Internal`Bag
System`Utilities`HashTable
System`RawArray
BooleanFunction
Dispatch (* since v10 *)
Dataset
Neural net functionality
AggregationLayer
BasicRecurrentLayer
BatchNormalizationLayer
CatenateLayer
ConstantArrayLayer
ConstantPlusLayer
ConstantTimesLayer
ContrastiveLossLayer
ConvolutionLayer
CrossEntropyLossLayer
DeconvolutionLayer
DotLayer
DropoutLayer
ElementwiseLayer
EmbeddingLayer
FlattenLayer
GatedRecurrentLayer
ImageAugmentationLayer
InstanceNormalizationLayer
LinearLayer
LocalResponseNormalizationLayer
LongShortTermMemoryLayer
MeanAbsoluteLossLayer
MeanSquaredLossLayer
NetChain
NetDecoder
NetEncoder
NetEvaluationMode
NetExtract
NetFoldOperator
NetGraph
NetInitialize
NetMapOperator
NetModel
NetNestOperator
NetPairEmbeddingOperator
NetPort
NetPortGradient
NetReplacePart
PaddingLayer
PartLayer
PoolingLayer
ReplicateLayer
ReshapeLayer
ResizeLayer
SequenceAttentionLayer
SequenceLastLayer
SequenceMostLayer
SequenceRestLayer
SequenceReverseLayer
SoftmaxLayer
SpatialTransformationLayer
SummationLayer
ThreadingLayer
TotalLayer
TransposeLayer
UnitVectorLayer
SparseArrays are actually not atomic, but just treated for most purposes as if they were. They are the only non-atomic atoms, though, as far as I know. And in addition to your list, there are several other undocumented atomic objects as well, such as theInternal\Bag, theSystem`Utilities`HashTable, theSystem`RawArray, and probably others besides. Several objects that should be atomic (by the standards of theSparseArray) aren't, such asCompiledFunctionandLibraryFunction`. – Oleksandr R. Apr 27 '14 at 03:38AtomQ: likeComplexandRationalnumbers,SparseArrayis atomic. List 'm usingCases[ Names["System*"], _?AtomQ]` – Wouter Apr 27 '14 at 15:55FullForm).SparseArrayclearly can be, regardless of whetherAtomQis true or false. Further down the documentation page forAtomQwe see some discussion about this, which shows the contradiction inherent in consideringSparseArrays as atomic. Now, it may be thatSparseArraytruly is atomic in terms of its underlying implementation, but unlike other atoms it has a meaningfulFullForm. – Oleksandr R. Apr 27 '14 at 17:10Imageisn't atomic in v7 and v8. – Szabolcs Apr 29 '14 at 16:54<|a -> 1, b -> 2|>[[1]]does not equala -> 1as seen inFullForm[<|a -> 1, b -> 2|>], shouldn't it be considered atomic? – Greg Hurst Jul 17 '14 at 18:00AtomQ. If an expression is compound (not atomic) that usually implies that it always behaves as one would expect based on its full form, including for the purposes of pattern matching, part extraction, etc. This is a simple and predictable model, so I think that there's value in preserving it. Also consider thatHold[Association[1->2]]is a true compound expression. IfAssociationis not considered atomic any more, thenHold[Association[1->2]]should behave precisely the same way as ... – Szabolcs Aug 05 '14 at 14:36With[{a = Association[1 -> 2]}, Hold[a]]. But it doesn't, there are differences (again, part extraction, pattern matching). Also considerSparseArray, which also has parts, but again doesn't behave identically to its FullForm.SparseArrayis also marked asAtomQfor this reason. Perhaps you could consider changing the description ofAtomQin the documentation instead of lettingAtomQreturnFalsefor associations. WhatAtomQreally means is a bit complicated, but it's valuable to have it, and changing it would break either consistency ... – Szabolcs Aug 05 '14 at 14:39Rawis outdated, but it is still atomic. – ybeltukov Oct 08 '14 at 15:00Graphicsobjects are not atomic. Try runningAtomQ[Graphics[{Circle[]}]]orFirst[Graphics[{Circle[]}]]. – Greg Hurst Sep 23 '15 at 22:21AtomQ[Underflow[]]isTrue.Underflow[][[0]]isReal, butHold[Underflow[]][[1,0]]isUnderflow. ButHold[Evaluate[Underflow[]]][[1, 0]]isRealagain, despite thatHold[Underflow[]]andHold[Evaluate[Underflow[]]]look identical inFullForm. The same note applies toOverflow[]. – Vladimir Reshetnikov Mar 08 '16 at 19:34Hold[1/2],Hold[2^-1],Hold[Evaluate[1/2]]andHold[Rational[1,2]]are all different expressions despite that some of them have the sameFullFormand reported as identical bySameQ. Among them,Rationalis atomic only inHold[Evaluate[1/2]]. Also, it is not atomic inRational[1, 2] &. So,Rationalis not necessarily atomic, but only after it has had an opportunity to be evaluated. The same applies to other heads. The exact structure and atomicity of expressions may be not always preserved byUncompress[Compress[…]]]. – Vladimir Reshetnikov Mar 08 '16 at 19:44AtomQ[Infinity]andAtomQ[ComplexInfinity]areFalse. Both symbols are converted to expessions withDirectedInfinityhead when evaluated, but it remains hidden both inStandardFormandInputForm. – Vladimir Reshetnikov Mar 08 '16 at 19:50{AtomQ[Raw[List, ""]], Head[Raw[List, ""]]}. But I suppose it counts as cheating. – Vladimir Reshetnikov Mar 10 '16 at 00:13