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
SymmetrizedArray
Image (* since v9 *)
Image3D
Graph
ColorProfileData
Association
MeshRegion
BoundaryMeshRegion
Language`ArrayObject
ByteArray
NumericArray
QuantityArray
RawArray
RawData
Audio
Video
Are there any others?
Special Structured Matrices
VandermondeMatrix
CauchyMatrix
ToeplitzMatrix
HankelMatrix
FourierMatrix
HilbertMatrix
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
SparseArray
s 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 asCompiledFunction
andLibraryFunction
. $\endgroup$Image
isn't atomic in v7 and v8. $\endgroup$With[{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.SparseArray
is also marked asAtomQ
for this reason. Perhaps you could consider changing the description ofAtomQ
in the documentation instead of lettingAtomQ
returnFalse
for associations. WhatAtomQ
really means is a bit complicated, but it's valuable to have it, and changing it would break either consistency ... $\endgroup$