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
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. $\endgroup$Imageisn'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.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 ... $\endgroup$