What does rare device refer to in the line 'It was a miracle of rare device' of Samuel Taylor Coleridge's poem, Kubla Khan?
The full lines are:
The shadow of the dome of pleasure
Floated midway on the waves;
Where was heard the mingled measure
From the fountain and the caves.
It was a miracle of rare device,
A sunny pleasure-dome with caves of ice!
The phrase rare device means that it (in this case, the "pleasure-dome") was uniquely devised. In other words, it is an incredible, "miraculous" creation.
Another example in literature includes:
"So fashioned a Porch with rare device..."
"As either might for wealth haue gotten beene, Or could be fram'd by workman's rare device."
-Edmund Spenser, The Faerie Queene
I believe in this case, device is being used much like we'd today use the word artifice. In other words, a complex manufactured or engineered object.
So basically what he meant by "rare device" is that this was a really impressive piece of complex engineering and craftmanship, not just your basic everyday building.